<!DOCTYPE html>
<html lang="en-US">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="language" content="en" />
        <link href="./assets/ffd55088/css/bootstrap.css" rel="stylesheet">
<link href="./assets/5cf9384a/solarized_light.css" rel="stylesheet">
<link href="./assets/6c54116e/style.css" rel="stylesheet">
<script src="./assets/a44cef0f/jquery.js"></script>
<script src="./assets/ffd55088/js/bootstrap.js"></script>
<script src="./assets/8ac4e28a/jssearch.js"></script>    <title>BaseActiveRecord, yii\db\BaseActiveRecord - Yii Framework 2.0 API Documentation</title>
</head>
<body>

<div class="wrap">
    <nav id="w8225" class="navbar-inverse navbar-fixed-top navbar" role="navigation"><div class="navbar-header"><button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#w8225-collapse"><span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span></button><a class="navbar-brand" href="./index.html">Yii Framework 2.0 API Documentation</a></div><div id="w8225-collapse" class="collapse navbar-collapse"><ul id="w8226" class="navbar-nav nav"><li><a href="./index.html">Class reference</a></li>
<li class="dropdown"><a class="dropdown-toggle" href="#" data-toggle="dropdown">Extensions <b class="caret"></b></a><ul id="w8227" class="dropdown-menu"><li><a href="./ext-apidoc-index.html" tabindex="-1">apidoc</a></li>
<li><a href="./ext-authclient-index.html" tabindex="-1">authclient</a></li>
<li><a href="./ext-bootstrap-index.html" tabindex="-1">bootstrap</a></li>
<li><a href="./ext-codeception-index.html" tabindex="-1">codeception</a></li>
<li><a href="./ext-debug-index.html" tabindex="-1">debug</a></li>
<li><a href="./ext-elasticsearch-index.html" tabindex="-1">elasticsearch</a></li>
<li><a href="./ext-faker-index.html" tabindex="-1">faker</a></li>
<li><a href="./ext-gii-index.html" tabindex="-1">gii</a></li>
<li><a href="./ext-imagine-index.html" tabindex="-1">imagine</a></li>
<li><a href="./ext-jui-index.html" tabindex="-1">jui</a></li>
<li><a href="./ext-mongodb-index.html" tabindex="-1">mongodb</a></li>
<li><a href="./ext-redis-index.html" tabindex="-1">redis</a></li>
<li><a href="./ext-smarty-index.html" tabindex="-1">smarty</a></li>
<li><a href="./ext-sphinx-index.html" tabindex="-1">sphinx</a></li>
<li><a href="./ext-swiftmailer-index.html" tabindex="-1">swiftmailer</a></li>
<li><a href="./ext-twig-index.html" tabindex="-1">twig</a></li></ul></li>
<li><a href="./guide-README.html">Guide</a></li></ul><div class="navbar-form navbar-left" role="search">
  <div class="form-group">
    <input id="searchbox" type="text" class="form-control" placeholder="Search">
  </div>
</div>
</div></nav>
    <div id="search-resultbox" style="display: none;" class="modal-content">
        <ul id="search-results">
        </ul>
    </div>

    
<div class="row">
    <div class="col-md-3">
                <div id="navigation" class="list-group"><a class="list-group-item" href="#navigation-8194" data-toggle="collapse" data-parent="#navigation">Not namespaced classes <b class="caret"></b></a><div id="navigation-8194" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii.html">Yii</a></div>
<a class="list-group-item" href="#navigation-8195" data-toggle="collapse" data-parent="#navigation">yii <b class="caret"></b></a><div id="navigation-8195" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-baseyii.html">BaseYii</a></div>
<a class="list-group-item" href="#navigation-8196" data-toggle="collapse" data-parent="#navigation">yii\base <b class="caret"></b></a><div id="navigation-8196" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-base-action.html">Action</a>
<a class="list-group-item" href="./yii-base-actionevent.html">ActionEvent</a>
<a class="list-group-item" href="./yii-base-actionfilter.html">ActionFilter</a>
<a class="list-group-item" href="./yii-base-application.html">Application</a>
<a class="list-group-item" href="./yii-base-arrayaccesstrait.html">ArrayAccessTrait</a>
<a class="list-group-item" href="./yii-base-arrayable.html">Arrayable</a>
<a class="list-group-item" href="./yii-base-arrayabletrait.html">ArrayableTrait</a>
<a class="list-group-item" href="./yii-base-behavior.html">Behavior</a>
<a class="list-group-item" href="./yii-base-bootstrapinterface.html">BootstrapInterface</a>
<a class="list-group-item" href="./yii-base-component.html">Component</a>
<a class="list-group-item" href="./yii-base-configurable.html">Configurable</a>
<a class="list-group-item" href="./yii-base-controller.html">Controller</a>
<a class="list-group-item" href="./yii-base-dynamicmodel.html">DynamicModel</a>
<a class="list-group-item" href="./yii-base-errorexception.html">ErrorException</a>
<a class="list-group-item" href="./yii-base-errorhandler.html">ErrorHandler</a>
<a class="list-group-item" href="./yii-base-event.html">Event</a>
<a class="list-group-item" href="./yii-base-exception.html">Exception</a>
<a class="list-group-item" href="./yii-base-exitexception.html">ExitException</a>
<a class="list-group-item" href="./yii-base-inlineaction.html">InlineAction</a>
<a class="list-group-item" href="./yii-base-invalidcallexception.html">InvalidCallException</a>
<a class="list-group-item" href="./yii-base-invalidconfigexception.html">InvalidConfigException</a>
<a class="list-group-item" href="./yii-base-invalidparamexception.html">InvalidParamException</a>
<a class="list-group-item" href="./yii-base-invalidrouteexception.html">InvalidRouteException</a>
<a class="list-group-item" href="./yii-base-invalidvalueexception.html">InvalidValueException</a>
<a class="list-group-item" href="./yii-base-model.html">Model</a>
<a class="list-group-item" href="./yii-base-modelevent.html">ModelEvent</a>
<a class="list-group-item" href="./yii-base-module.html">Module</a>
<a class="list-group-item" href="./yii-base-notsupportedexception.html">NotSupportedException</a>
<a class="list-group-item" href="./yii-base-object.html">Object</a>
<a class="list-group-item" href="./yii-base-request.html">Request</a>
<a class="list-group-item" href="./yii-base-response.html">Response</a>
<a class="list-group-item" href="./yii-base-security.html">Security</a>
<a class="list-group-item" href="./yii-base-theme.html">Theme</a>
<a class="list-group-item" href="./yii-base-unknownclassexception.html">UnknownClassException</a>
<a class="list-group-item" href="./yii-base-unknownmethodexception.html">UnknownMethodException</a>
<a class="list-group-item" href="./yii-base-unknownpropertyexception.html">UnknownPropertyException</a>
<a class="list-group-item" href="./yii-base-userexception.html">UserException</a>
<a class="list-group-item" href="./yii-base-view.html">View</a>
<a class="list-group-item" href="./yii-base-viewcontextinterface.html">ViewContextInterface</a>
<a class="list-group-item" href="./yii-base-viewevent.html">ViewEvent</a>
<a class="list-group-item" href="./yii-base-viewrenderer.html">ViewRenderer</a>
<a class="list-group-item" href="./yii-base-widget.html">Widget</a></div>
<a class="list-group-item" href="#navigation-8197" data-toggle="collapse" data-parent="#navigation">yii\behaviors <b class="caret"></b></a><div id="navigation-8197" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-behaviors-attributebehavior.html">AttributeBehavior</a>
<a class="list-group-item" href="./yii-behaviors-blameablebehavior.html">BlameableBehavior</a>
<a class="list-group-item" href="./yii-behaviors-sluggablebehavior.html">SluggableBehavior</a>
<a class="list-group-item" href="./yii-behaviors-timestampbehavior.html">TimestampBehavior</a></div>
<a class="list-group-item" href="#navigation-8198" data-toggle="collapse" data-parent="#navigation">yii\caching <b class="caret"></b></a><div id="navigation-8198" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-caching-apccache.html">ApcCache</a>
<a class="list-group-item" href="./yii-caching-arraycache.html">ArrayCache</a>
<a class="list-group-item" href="./yii-caching-cache.html">Cache</a>
<a class="list-group-item" href="./yii-caching-chaineddependency.html">ChainedDependency</a>
<a class="list-group-item" href="./yii-caching-dbcache.html">DbCache</a>
<a class="list-group-item" href="./yii-caching-dbdependency.html">DbDependency</a>
<a class="list-group-item" href="./yii-caching-dependency.html">Dependency</a>
<a class="list-group-item" href="./yii-caching-dummycache.html">DummyCache</a>
<a class="list-group-item" href="./yii-caching-expressiondependency.html">ExpressionDependency</a>
<a class="list-group-item" href="./yii-caching-filecache.html">FileCache</a>
<a class="list-group-item" href="./yii-caching-filedependency.html">FileDependency</a>
<a class="list-group-item" href="./yii-caching-memcache.html">MemCache</a>
<a class="list-group-item" href="./yii-caching-memcacheserver.html">MemCacheServer</a>
<a class="list-group-item" href="./yii-caching-tagdependency.html">TagDependency</a>
<a class="list-group-item" href="./yii-caching-wincache.html">WinCache</a>
<a class="list-group-item" href="./yii-caching-xcache.html">XCache</a>
<a class="list-group-item" href="./yii-caching-zenddatacache.html">ZendDataCache</a></div>
<a class="list-group-item" href="#navigation-8199" data-toggle="collapse" data-parent="#navigation">yii\captcha <b class="caret"></b></a><div id="navigation-8199" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-captcha-captcha.html">Captcha</a>
<a class="list-group-item" href="./yii-captcha-captchaaction.html">CaptchaAction</a>
<a class="list-group-item" href="./yii-captcha-captchaasset.html">CaptchaAsset</a>
<a class="list-group-item" href="./yii-captcha-captchavalidator.html">CaptchaValidator</a></div>
<a class="list-group-item" href="#navigation-8200" data-toggle="collapse" data-parent="#navigation">yii\console <b class="caret"></b></a><div id="navigation-8200" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-console-application.html">Application</a>
<a class="list-group-item" href="./yii-console-controller.html">Controller</a>
<a class="list-group-item" href="./yii-console-errorhandler.html">ErrorHandler</a>
<a class="list-group-item" href="./yii-console-exception.html">Exception</a>
<a class="list-group-item" href="./yii-console-markdown.html">Markdown</a>
<a class="list-group-item" href="./yii-console-request.html">Request</a>
<a class="list-group-item" href="./yii-console-response.html">Response</a></div>
<a class="list-group-item" href="#navigation-8201" data-toggle="collapse" data-parent="#navigation">yii\console\controllers <b class="caret"></b></a><div id="navigation-8201" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-console-controllers-assetcontroller.html">AssetController</a>
<a class="list-group-item" href="./yii-console-controllers-basemigratecontroller.html">BaseMigrateController</a>
<a class="list-group-item" href="./yii-console-controllers-cachecontroller.html">CacheController</a>
<a class="list-group-item" href="./yii-console-controllers-fixturecontroller.html">FixtureController</a>
<a class="list-group-item" href="./yii-console-controllers-helpcontroller.html">HelpController</a>
<a class="list-group-item" href="./yii-console-controllers-messagecontroller.html">MessageController</a>
<a class="list-group-item" href="./yii-console-controllers-migratecontroller.html">MigrateController</a>
<a class="list-group-item" href="./yii-console-controllers-servecontroller.html">ServeController</a></div>
<a class="list-group-item" href="#navigation-8202" data-toggle="collapse" data-parent="#navigation">yii\data <b class="caret"></b></a><div id="navigation-8202" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-data-activedataprovider.html">ActiveDataProvider</a>
<a class="list-group-item" href="./yii-data-arraydataprovider.html">ArrayDataProvider</a>
<a class="list-group-item" href="./yii-data-basedataprovider.html">BaseDataProvider</a>
<a class="list-group-item" href="./yii-data-dataproviderinterface.html">DataProviderInterface</a>
<a class="list-group-item" href="./yii-data-pagination.html">Pagination</a>
<a class="list-group-item" href="./yii-data-sort.html">Sort</a>
<a class="list-group-item" href="./yii-data-sqldataprovider.html">SqlDataProvider</a></div>
<a class="list-group-item active" href="#navigation-8203" data-toggle="collapse" data-parent="#navigation">yii\db <b class="caret"></b></a><div id="navigation-8203" class="submenu panel-collapse collapse in"><a class="list-group-item" href="./yii-db-activequery.html">ActiveQuery</a>
<a class="list-group-item" href="./yii-db-activequeryinterface.html">ActiveQueryInterface</a>
<a class="list-group-item" href="./yii-db-activequerytrait.html">ActiveQueryTrait</a>
<a class="list-group-item" href="./yii-db-activerecord.html">ActiveRecord</a>
<a class="list-group-item" href="./yii-db-activerecordinterface.html">ActiveRecordInterface</a>
<a class="list-group-item" href="./yii-db-activerelationtrait.html">ActiveRelationTrait</a>
<a class="list-group-item" href="./yii-db-aftersaveevent.html">AfterSaveEvent</a>
<a class="list-group-item active" href="./yii-db-baseactiverecord.html">BaseActiveRecord</a>
<a class="list-group-item" href="./yii-db-batchqueryresult.html">BatchQueryResult</a>
<a class="list-group-item" href="./yii-db-columnschema.html">ColumnSchema</a>
<a class="list-group-item" href="./yii-db-columnschemabuilder.html">ColumnSchemaBuilder</a>
<a class="list-group-item" href="./yii-db-command.html">Command</a>
<a class="list-group-item" href="./yii-db-connection.html">Connection</a>
<a class="list-group-item" href="./yii-db-datareader.html">DataReader</a>
<a class="list-group-item" href="./yii-db-exception.html">Exception</a>
<a class="list-group-item" href="./yii-db-expression.html">Expression</a>
<a class="list-group-item" href="./yii-db-integrityexception.html">IntegrityException</a>
<a class="list-group-item" href="./yii-db-migration.html">Migration</a>
<a class="list-group-item" href="./yii-db-migrationinterface.html">MigrationInterface</a>
<a class="list-group-item" href="./yii-db-query.html">Query</a>
<a class="list-group-item" href="./yii-db-querybuilder.html">QueryBuilder</a>
<a class="list-group-item" href="./yii-db-queryinterface.html">QueryInterface</a>
<a class="list-group-item" href="./yii-db-querytrait.html">QueryTrait</a>
<a class="list-group-item" href="./yii-db-schema.html">Schema</a>
<a class="list-group-item" href="./yii-db-schemabuildertrait.html">SchemaBuilderTrait</a>
<a class="list-group-item" href="./yii-db-staleobjectexception.html">StaleObjectException</a>
<a class="list-group-item" href="./yii-db-tableschema.html">TableSchema</a>
<a class="list-group-item" href="./yii-db-transaction.html">Transaction</a></div>
<a class="list-group-item" href="#navigation-8204" data-toggle="collapse" data-parent="#navigation">yii\db\cubrid <b class="caret"></b></a><div id="navigation-8204" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-db-cubrid-columnschemabuilder.html">ColumnSchemaBuilder</a>
<a class="list-group-item" href="./yii-db-cubrid-querybuilder.html">QueryBuilder</a>
<a class="list-group-item" href="./yii-db-cubrid-schema.html">Schema</a></div>
<a class="list-group-item" href="#navigation-8205" data-toggle="collapse" data-parent="#navigation">yii\db\mssql <b class="caret"></b></a><div id="navigation-8205" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-db-mssql-pdo.html">PDO</a>
<a class="list-group-item" href="./yii-db-mssql-querybuilder.html">QueryBuilder</a>
<a class="list-group-item" href="./yii-db-mssql-schema.html">Schema</a>
<a class="list-group-item" href="./yii-db-mssql-sqlsrvpdo.html">SqlsrvPDO</a>
<a class="list-group-item" href="./yii-db-mssql-tableschema.html">TableSchema</a></div>
<a class="list-group-item" href="#navigation-8206" data-toggle="collapse" data-parent="#navigation">yii\db\mysql <b class="caret"></b></a><div id="navigation-8206" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-db-mysql-columnschemabuilder.html">ColumnSchemaBuilder</a>
<a class="list-group-item" href="./yii-db-mysql-querybuilder.html">QueryBuilder</a>
<a class="list-group-item" href="./yii-db-mysql-schema.html">Schema</a></div>
<a class="list-group-item" href="#navigation-8207" data-toggle="collapse" data-parent="#navigation">yii\db\oci <b class="caret"></b></a><div id="navigation-8207" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-db-oci-columnschemabuilder.html">ColumnSchemaBuilder</a>
<a class="list-group-item" href="./yii-db-oci-querybuilder.html">QueryBuilder</a>
<a class="list-group-item" href="./yii-db-oci-schema.html">Schema</a></div>
<a class="list-group-item" href="#navigation-8208" data-toggle="collapse" data-parent="#navigation">yii\db\pgsql <b class="caret"></b></a><div id="navigation-8208" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-db-pgsql-querybuilder.html">QueryBuilder</a>
<a class="list-group-item" href="./yii-db-pgsql-schema.html">Schema</a></div>
<a class="list-group-item" href="#navigation-8209" data-toggle="collapse" data-parent="#navigation">yii\db\sqlite <b class="caret"></b></a><div id="navigation-8209" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-db-sqlite-columnschemabuilder.html">ColumnSchemaBuilder</a>
<a class="list-group-item" href="./yii-db-sqlite-querybuilder.html">QueryBuilder</a>
<a class="list-group-item" href="./yii-db-sqlite-schema.html">Schema</a></div>
<a class="list-group-item" href="#navigation-8210" data-toggle="collapse" data-parent="#navigation">yii\di <b class="caret"></b></a><div id="navigation-8210" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-di-container.html">Container</a>
<a class="list-group-item" href="./yii-di-instance.html">Instance</a>
<a class="list-group-item" href="./yii-di-notinstantiableexception.html">NotInstantiableException</a>
<a class="list-group-item" href="./yii-di-servicelocator.html">ServiceLocator</a></div>
<a class="list-group-item" href="#navigation-8211" data-toggle="collapse" data-parent="#navigation">yii\filters <b class="caret"></b></a><div id="navigation-8211" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-filters-accesscontrol.html">AccessControl</a>
<a class="list-group-item" href="./yii-filters-accessrule.html">AccessRule</a>
<a class="list-group-item" href="./yii-filters-contentnegotiator.html">ContentNegotiator</a>
<a class="list-group-item" href="./yii-filters-cors.html">Cors</a>
<a class="list-group-item" href="./yii-filters-httpcache.html">HttpCache</a>
<a class="list-group-item" href="./yii-filters-pagecache.html">PageCache</a>
<a class="list-group-item" href="./yii-filters-ratelimitinterface.html">RateLimitInterface</a>
<a class="list-group-item" href="./yii-filters-ratelimiter.html">RateLimiter</a>
<a class="list-group-item" href="./yii-filters-verbfilter.html">VerbFilter</a></div>
<a class="list-group-item" href="#navigation-8212" data-toggle="collapse" data-parent="#navigation">yii\filters\auth <b class="caret"></b></a><div id="navigation-8212" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-filters-auth-authinterface.html">AuthInterface</a>
<a class="list-group-item" href="./yii-filters-auth-authmethod.html">AuthMethod</a>
<a class="list-group-item" href="./yii-filters-auth-compositeauth.html">CompositeAuth</a>
<a class="list-group-item" href="./yii-filters-auth-httpbasicauth.html">HttpBasicAuth</a>
<a class="list-group-item" href="./yii-filters-auth-httpbearerauth.html">HttpBearerAuth</a>
<a class="list-group-item" href="./yii-filters-auth-queryparamauth.html">QueryParamAuth</a></div>
<a class="list-group-item" href="#navigation-8213" data-toggle="collapse" data-parent="#navigation">yii\grid <b class="caret"></b></a><div id="navigation-8213" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-grid-actioncolumn.html">ActionColumn</a>
<a class="list-group-item" href="./yii-grid-checkboxcolumn.html">CheckboxColumn</a>
<a class="list-group-item" href="./yii-grid-column.html">Column</a>
<a class="list-group-item" href="./yii-grid-datacolumn.html">DataColumn</a>
<a class="list-group-item" href="./yii-grid-gridview.html">GridView</a>
<a class="list-group-item" href="./yii-grid-gridviewasset.html">GridViewAsset</a>
<a class="list-group-item" href="./yii-grid-serialcolumn.html">SerialColumn</a></div>
<a class="list-group-item" href="#navigation-8214" data-toggle="collapse" data-parent="#navigation">yii\helpers <b class="caret"></b></a><div id="navigation-8214" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-helpers-arrayhelper.html">ArrayHelper</a>
<a class="list-group-item" href="./yii-helpers-basearrayhelper.html">BaseArrayHelper</a>
<a class="list-group-item" href="./yii-helpers-baseconsole.html">BaseConsole</a>
<a class="list-group-item" href="./yii-helpers-basefilehelper.html">BaseFileHelper</a>
<a class="list-group-item" href="./yii-helpers-baseformatconverter.html">BaseFormatConverter</a>
<a class="list-group-item" href="./yii-helpers-basehtml.html">BaseHtml</a>
<a class="list-group-item" href="./yii-helpers-basehtmlpurifier.html">BaseHtmlPurifier</a>
<a class="list-group-item" href="./yii-helpers-baseinflector.html">BaseInflector</a>
<a class="list-group-item" href="./yii-helpers-basejson.html">BaseJson</a>
<a class="list-group-item" href="./yii-helpers-basemarkdown.html">BaseMarkdown</a>
<a class="list-group-item" href="./yii-helpers-basestringhelper.html">BaseStringHelper</a>
<a class="list-group-item" href="./yii-helpers-baseurl.html">BaseUrl</a>
<a class="list-group-item" href="./yii-helpers-basevardumper.html">BaseVarDumper</a>
<a class="list-group-item" href="./yii-helpers-console.html">Console</a>
<a class="list-group-item" href="./yii-helpers-filehelper.html">FileHelper</a>
<a class="list-group-item" href="./yii-helpers-formatconverter.html">FormatConverter</a>
<a class="list-group-item" href="./yii-helpers-html.html">Html</a>
<a class="list-group-item" href="./yii-helpers-htmlpurifier.html">HtmlPurifier</a>
<a class="list-group-item" href="./yii-helpers-inflector.html">Inflector</a>
<a class="list-group-item" href="./yii-helpers-json.html">Json</a>
<a class="list-group-item" href="./yii-helpers-markdown.html">Markdown</a>
<a class="list-group-item" href="./yii-helpers-stringhelper.html">StringHelper</a>
<a class="list-group-item" href="./yii-helpers-url.html">Url</a>
<a class="list-group-item" href="./yii-helpers-vardumper.html">VarDumper</a></div>
<a class="list-group-item" href="#navigation-8215" data-toggle="collapse" data-parent="#navigation">yii\i18n <b class="caret"></b></a><div id="navigation-8215" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-i18n-dbmessagesource.html">DbMessageSource</a>
<a class="list-group-item" href="./yii-i18n-formatter.html">Formatter</a>
<a class="list-group-item" href="./yii-i18n-gettextfile.html">GettextFile</a>
<a class="list-group-item" href="./yii-i18n-gettextmessagesource.html">GettextMessageSource</a>
<a class="list-group-item" href="./yii-i18n-gettextmofile.html">GettextMoFile</a>
<a class="list-group-item" href="./yii-i18n-gettextpofile.html">GettextPoFile</a>
<a class="list-group-item" href="./yii-i18n-i18n.html">I18N</a>
<a class="list-group-item" href="./yii-i18n-messageformatter.html">MessageFormatter</a>
<a class="list-group-item" href="./yii-i18n-messagesource.html">MessageSource</a>
<a class="list-group-item" href="./yii-i18n-missingtranslationevent.html">MissingTranslationEvent</a>
<a class="list-group-item" href="./yii-i18n-phpmessagesource.html">PhpMessageSource</a></div>
<a class="list-group-item" href="#navigation-8216" data-toggle="collapse" data-parent="#navigation">yii\log <b class="caret"></b></a><div id="navigation-8216" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-log-dbtarget.html">DbTarget</a>
<a class="list-group-item" href="./yii-log-dispatcher.html">Dispatcher</a>
<a class="list-group-item" href="./yii-log-emailtarget.html">EmailTarget</a>
<a class="list-group-item" href="./yii-log-filetarget.html">FileTarget</a>
<a class="list-group-item" href="./yii-log-logger.html">Logger</a>
<a class="list-group-item" href="./yii-log-syslogtarget.html">SyslogTarget</a>
<a class="list-group-item" href="./yii-log-target.html">Target</a></div>
<a class="list-group-item" href="#navigation-8217" data-toggle="collapse" data-parent="#navigation">yii\mail <b class="caret"></b></a><div id="navigation-8217" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mail-basemailer.html">BaseMailer</a>
<a class="list-group-item" href="./yii-mail-basemessage.html">BaseMessage</a>
<a class="list-group-item" href="./yii-mail-mailevent.html">MailEvent</a>
<a class="list-group-item" href="./yii-mail-mailerinterface.html">MailerInterface</a>
<a class="list-group-item" href="./yii-mail-messageinterface.html">MessageInterface</a></div>
<a class="list-group-item" href="#navigation-8218" data-toggle="collapse" data-parent="#navigation">yii\mutex <b class="caret"></b></a><div id="navigation-8218" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mutex-dbmutex.html">DbMutex</a>
<a class="list-group-item" href="./yii-mutex-filemutex.html">FileMutex</a>
<a class="list-group-item" href="./yii-mutex-mutex.html">Mutex</a>
<a class="list-group-item" href="./yii-mutex-mysqlmutex.html">MysqlMutex</a>
<a class="list-group-item" href="./yii-mutex-pgsqlmutex.html">PgsqlMutex</a></div>
<a class="list-group-item" href="#navigation-8219" data-toggle="collapse" data-parent="#navigation">yii\rbac <b class="caret"></b></a><div id="navigation-8219" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-rbac-assignment.html">Assignment</a>
<a class="list-group-item" href="./yii-rbac-basemanager.html">BaseManager</a>
<a class="list-group-item" href="./yii-rbac-checkaccessinterface.html">CheckAccessInterface</a>
<a class="list-group-item" href="./yii-rbac-dbmanager.html">DbManager</a>
<a class="list-group-item" href="./yii-rbac-item.html">Item</a>
<a class="list-group-item" href="./yii-rbac-managerinterface.html">ManagerInterface</a>
<a class="list-group-item" href="./yii-rbac-permission.html">Permission</a>
<a class="list-group-item" href="./yii-rbac-phpmanager.html">PhpManager</a>
<a class="list-group-item" href="./yii-rbac-role.html">Role</a>
<a class="list-group-item" href="./yii-rbac-rule.html">Rule</a></div>
<a class="list-group-item" href="#navigation-8220" data-toggle="collapse" data-parent="#navigation">yii\rest <b class="caret"></b></a><div id="navigation-8220" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-rest-action.html">Action</a>
<a class="list-group-item" href="./yii-rest-activecontroller.html">ActiveController</a>
<a class="list-group-item" href="./yii-rest-controller.html">Controller</a>
<a class="list-group-item" href="./yii-rest-createaction.html">CreateAction</a>
<a class="list-group-item" href="./yii-rest-deleteaction.html">DeleteAction</a>
<a class="list-group-item" href="./yii-rest-indexaction.html">IndexAction</a>
<a class="list-group-item" href="./yii-rest-optionsaction.html">OptionsAction</a>
<a class="list-group-item" href="./yii-rest-serializer.html">Serializer</a>
<a class="list-group-item" href="./yii-rest-updateaction.html">UpdateAction</a>
<a class="list-group-item" href="./yii-rest-urlrule.html">UrlRule</a>
<a class="list-group-item" href="./yii-rest-viewaction.html">ViewAction</a></div>
<a class="list-group-item" href="#navigation-8221" data-toggle="collapse" data-parent="#navigation">yii\test <b class="caret"></b></a><div id="navigation-8221" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-test-activefixture.html">ActiveFixture</a>
<a class="list-group-item" href="./yii-test-arrayfixture.html">ArrayFixture</a>
<a class="list-group-item" href="./yii-test-baseactivefixture.html">BaseActiveFixture</a>
<a class="list-group-item" href="./yii-test-dbfixture.html">DbFixture</a>
<a class="list-group-item" href="./yii-test-fixture.html">Fixture</a>
<a class="list-group-item" href="./yii-test-fixturetrait.html">FixtureTrait</a>
<a class="list-group-item" href="./yii-test-initdbfixture.html">InitDbFixture</a></div>
<a class="list-group-item" href="#navigation-8222" data-toggle="collapse" data-parent="#navigation">yii\validators <b class="caret"></b></a><div id="navigation-8222" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-validators-booleanvalidator.html">BooleanValidator</a>
<a class="list-group-item" href="./yii-validators-comparevalidator.html">CompareValidator</a>
<a class="list-group-item" href="./yii-validators-datevalidator.html">DateValidator</a>
<a class="list-group-item" href="./yii-validators-defaultvaluevalidator.html">DefaultValueValidator</a>
<a class="list-group-item" href="./yii-validators-eachvalidator.html">EachValidator</a>
<a class="list-group-item" href="./yii-validators-emailvalidator.html">EmailValidator</a>
<a class="list-group-item" href="./yii-validators-existvalidator.html">ExistValidator</a>
<a class="list-group-item" href="./yii-validators-filevalidator.html">FileValidator</a>
<a class="list-group-item" href="./yii-validators-filtervalidator.html">FilterValidator</a>
<a class="list-group-item" href="./yii-validators-imagevalidator.html">ImageValidator</a>
<a class="list-group-item" href="./yii-validators-inlinevalidator.html">InlineValidator</a>
<a class="list-group-item" href="./yii-validators-ipvalidator.html">IpValidator</a>
<a class="list-group-item" href="./yii-validators-numbervalidator.html">NumberValidator</a>
<a class="list-group-item" href="./yii-validators-punycodeasset.html">PunycodeAsset</a>
<a class="list-group-item" href="./yii-validators-rangevalidator.html">RangeValidator</a>
<a class="list-group-item" href="./yii-validators-regularexpressionvalidator.html">RegularExpressionValidator</a>
<a class="list-group-item" href="./yii-validators-requiredvalidator.html">RequiredValidator</a>
<a class="list-group-item" href="./yii-validators-safevalidator.html">SafeValidator</a>
<a class="list-group-item" href="./yii-validators-stringvalidator.html">StringValidator</a>
<a class="list-group-item" href="./yii-validators-uniquevalidator.html">UniqueValidator</a>
<a class="list-group-item" href="./yii-validators-urlvalidator.html">UrlValidator</a>
<a class="list-group-item" href="./yii-validators-validationasset.html">ValidationAsset</a>
<a class="list-group-item" href="./yii-validators-validator.html">Validator</a></div>
<a class="list-group-item" href="#navigation-8223" data-toggle="collapse" data-parent="#navigation">yii\web <b class="caret"></b></a><div id="navigation-8223" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-web-application.html">Application</a>
<a class="list-group-item" href="./yii-web-assetbundle.html">AssetBundle</a>
<a class="list-group-item" href="./yii-web-assetconverter.html">AssetConverter</a>
<a class="list-group-item" href="./yii-web-assetconverterinterface.html">AssetConverterInterface</a>
<a class="list-group-item" href="./yii-web-assetmanager.html">AssetManager</a>
<a class="list-group-item" href="./yii-web-badrequesthttpexception.html">BadRequestHttpException</a>
<a class="list-group-item" href="./yii-web-cachesession.html">CacheSession</a>
<a class="list-group-item" href="./yii-web-compositeurlrule.html">CompositeUrlRule</a>
<a class="list-group-item" href="./yii-web-conflicthttpexception.html">ConflictHttpException</a>
<a class="list-group-item" href="./yii-web-controller.html">Controller</a>
<a class="list-group-item" href="./yii-web-cookie.html">Cookie</a>
<a class="list-group-item" href="./yii-web-cookiecollection.html">CookieCollection</a>
<a class="list-group-item" href="./yii-web-dbsession.html">DbSession</a>
<a class="list-group-item" href="./yii-web-erroraction.html">ErrorAction</a>
<a class="list-group-item" href="./yii-web-errorhandler.html">ErrorHandler</a>
<a class="list-group-item" href="./yii-web-forbiddenhttpexception.html">ForbiddenHttpException</a>
<a class="list-group-item" href="./yii-web-gonehttpexception.html">GoneHttpException</a>
<a class="list-group-item" href="./yii-web-groupurlrule.html">GroupUrlRule</a>
<a class="list-group-item" href="./yii-web-headercollection.html">HeaderCollection</a>
<a class="list-group-item" href="./yii-web-htmlresponseformatter.html">HtmlResponseFormatter</a>
<a class="list-group-item" href="./yii-web-httpexception.html">HttpException</a>
<a class="list-group-item" href="./yii-web-identityinterface.html">IdentityInterface</a>
<a class="list-group-item" href="./yii-web-jqueryasset.html">JqueryAsset</a>
<a class="list-group-item" href="./yii-web-jsexpression.html">JsExpression</a>
<a class="list-group-item" href="./yii-web-jsonparser.html">JsonParser</a>
<a class="list-group-item" href="./yii-web-jsonresponseformatter.html">JsonResponseFormatter</a>
<a class="list-group-item" href="./yii-web-link.html">Link</a>
<a class="list-group-item" href="./yii-web-linkable.html">Linkable</a>
<a class="list-group-item" href="./yii-web-methodnotallowedhttpexception.html">MethodNotAllowedHttpException</a>
<a class="list-group-item" href="./yii-web-multifieldsession.html">MultiFieldSession</a>
<a class="list-group-item" href="./yii-web-notacceptablehttpexception.html">NotAcceptableHttpException</a>
<a class="list-group-item" href="./yii-web-notfoundhttpexception.html">NotFoundHttpException</a>
<a class="list-group-item" href="./yii-web-request.html">Request</a>
<a class="list-group-item" href="./yii-web-requestparserinterface.html">RequestParserInterface</a>
<a class="list-group-item" href="./yii-web-response.html">Response</a>
<a class="list-group-item" href="./yii-web-responseformatterinterface.html">ResponseFormatterInterface</a>
<a class="list-group-item" href="./yii-web-servererrorhttpexception.html">ServerErrorHttpException</a>
<a class="list-group-item" href="./yii-web-session.html">Session</a>
<a class="list-group-item" href="./yii-web-sessioniterator.html">SessionIterator</a>
<a class="list-group-item" href="./yii-web-toomanyrequestshttpexception.html">TooManyRequestsHttpException</a>
<a class="list-group-item" href="./yii-web-unauthorizedhttpexception.html">UnauthorizedHttpException</a>
<a class="list-group-item" href="./yii-web-unprocessableentityhttpexception.html">UnprocessableEntityHttpException</a>
<a class="list-group-item" href="./yii-web-unsupportedmediatypehttpexception.html">UnsupportedMediaTypeHttpException</a>
<a class="list-group-item" href="./yii-web-uploadedfile.html">UploadedFile</a>
<a class="list-group-item" href="./yii-web-urlmanager.html">UrlManager</a>
<a class="list-group-item" href="./yii-web-urlrule.html">UrlRule</a>
<a class="list-group-item" href="./yii-web-urlruleinterface.html">UrlRuleInterface</a>
<a class="list-group-item" href="./yii-web-user.html">User</a>
<a class="list-group-item" href="./yii-web-userevent.html">UserEvent</a>
<a class="list-group-item" href="./yii-web-view.html">View</a>
<a class="list-group-item" href="./yii-web-viewaction.html">ViewAction</a>
<a class="list-group-item" href="./yii-web-xmlresponseformatter.html">XmlResponseFormatter</a>
<a class="list-group-item" href="./yii-web-yiiasset.html">YiiAsset</a></div>
<a class="list-group-item" href="#navigation-8224" data-toggle="collapse" data-parent="#navigation">yii\widgets <b class="caret"></b></a><div id="navigation-8224" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-widgets-activefield.html">ActiveField</a>
<a class="list-group-item" href="./yii-widgets-activeform.html">ActiveForm</a>
<a class="list-group-item" href="./yii-widgets-activeformasset.html">ActiveFormAsset</a>
<a class="list-group-item" href="./yii-widgets-baselistview.html">BaseListView</a>
<a class="list-group-item" href="./yii-widgets-block.html">Block</a>
<a class="list-group-item" href="./yii-widgets-breadcrumbs.html">Breadcrumbs</a>
<a class="list-group-item" href="./yii-widgets-contentdecorator.html">ContentDecorator</a>
<a class="list-group-item" href="./yii-widgets-detailview.html">DetailView</a>
<a class="list-group-item" href="./yii-widgets-fragmentcache.html">FragmentCache</a>
<a class="list-group-item" href="./yii-widgets-inputwidget.html">InputWidget</a>
<a class="list-group-item" href="./yii-widgets-linkpager.html">LinkPager</a>
<a class="list-group-item" href="./yii-widgets-linksorter.html">LinkSorter</a>
<a class="list-group-item" href="./yii-widgets-listview.html">ListView</a>
<a class="list-group-item" href="./yii-widgets-maskedinput.html">MaskedInput</a>
<a class="list-group-item" href="./yii-widgets-maskedinputasset.html">MaskedInputAsset</a>
<a class="list-group-item" href="./yii-widgets-menu.html">Menu</a>
<a class="list-group-item" href="./yii-widgets-pjax.html">Pjax</a>
<a class="list-group-item" href="./yii-widgets-pjaxasset.html">PjaxAsset</a>
<a class="list-group-item" href="./yii-widgets-spaceless.html">Spaceless</a></div></div>    </div>
    <div class="col-md-9 api-content" role="main">
        <h1>Abstract Class yii\db\BaseActiveRecord</h1>
<div class="top-nav">
    <a href="index.html">All Classes</a>
            | <a href="#properties">Properties</a>
                | <a href="#methods">Methods</a>
                | <a href="#events">Events</a>
                | <a href="#constants">Constants</a>
    </div>

<table class="summaryTable docClass table table-bordered">
    <colgroup>
        <col class="col-name" />
        <col class="col-value" />
    </colgroup>
            <tr><th>Inheritance</th><td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a> &raquo;
<a href="yii-base-model.html">yii\base\Model</a> &raquo;
<a href="yii-base-component.html">yii\base\Component</a> &raquo;
<a href="yii-base-object.html">yii\base\Object</a></td></tr>
                <tr><th>Implements</th><td><a href="http://www.php.net/class.arrayaccess">ArrayAccess</a>, <a href="http://www.php.net/class.iteratoraggregate">IteratorAggregate</a>, <a href="yii-base-arrayable.html">yii\base\Arrayable</a>, <a href="yii-base-configurable.html">yii\base\Configurable</a>, <a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td></tr>
                    <tr><th>Uses Traits</th><td><a href="yii-base-arrayabletrait.html">yii\base\ArrayableTrait</a></td></tr>
                <tr><th>Subclasses</th><td><a href="yii-db-activerecord.html">yii\db\ActiveRecord</a>, <a href="yii-elasticsearch-activerecord.html">yii\elasticsearch\ActiveRecord</a>, <a href="yii-mongodb-activerecord.html">yii\mongodb\ActiveRecord</a>, <a href="yii-mongodb-file-activerecord.html">yii\mongodb\file\ActiveRecord</a>, <a href="yii-redis-activerecord.html">yii\redis\ActiveRecord</a>, <a href="yii-sphinx-activerecord.html">yii\sphinx\ActiveRecord</a></td></tr>
                        <tr><th>Available since version</th><td>2.0</td></tr>
                    <tr>
          <th>Source Code</th>
          <td><a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php">https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php</a></td>
        </tr>
    </table>

<div class="class-description">
    <p><strong>ActiveRecord is the base class for classes representing relational data in terms of objects.</strong></p>
    <p>See <a href="yii-db-activerecord.html">yii\db\ActiveRecord</a> for a concrete implementation.</p>

    </div>

<a id="properties"></a>

<div class="summary doc-property">
<h2>Public Properties</h2>

<p><a href="#" class="toggle">Hide inherited properties</a></p>

<table class="summary-table table table-striped table-bordered table-hover">
<colgroup>
    <col class="col-property" />
    <col class="col-type" />
    <col class="col-description" />
    <col class="col-defined" />
</colgroup>
<tr>
  <th>Property</th><th>Type</th><th>Description</th><th>Defined By</th>
</tr>
        <tr class="inherited" id="$activeValidators">
        <td><a href="yii-base-model.html#$activeValidators-detail">$activeValidators</a></td>
        <td><a href="yii-validators-validator.html">yii\validators\Validator</a>[]</td>
        <td>The validators applicable to the current <a href="yii-base-model.html#$scenario-detail">$scenario</a>.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="$attributes">
        <td><a href="yii-base-model.html#$attributes-detail">$attributes</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>Attribute values (name =&gt; value).</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="$behaviors">
        <td><a href="yii-base-component.html#$behaviors-detail">$behaviors</a></td>
        <td><a href="yii-base-behavior.html">yii\base\Behavior</a>[]</td>
        <td>List of behaviors attached to this component</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr id="$dirtyAttributes">
        <td><a href="yii-db-baseactiverecord.html#$dirtyAttributes-detail">$dirtyAttributes</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>The changed attribute values (name-value pairs)</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="$errors">
        <td><a href="yii-base-model.html#$errors-detail">$errors</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>Errors for all attributes or the specified attribute.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="$firstErrors">
        <td><a href="yii-base-model.html#$firstErrors-detail">$firstErrors</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>The first errors.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="$isNewRecord">
        <td><a href="yii-db-baseactiverecord.html#$isNewRecord-detail">$isNewRecord</a></td>
        <td><a href="http://www.php.net/language.types.boolean">boolean</a></td>
        <td>Whether the record is new and should be inserted when calling <a href="yii-db-baseactiverecord.html#save()-detail">save()</a>.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="$iterator">
        <td><a href="yii-base-model.html#$iterator-detail">$iterator</a></td>
        <td><a href="http://www.php.net/class.arrayiterator">ArrayIterator</a></td>
        <td>An iterator for traversing the items in the list.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="$oldAttributes">
        <td><a href="yii-db-baseactiverecord.html#$oldAttributes-detail">$oldAttributes</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>The old attribute values (name-value pairs)</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="$oldPrimaryKey">
        <td><a href="yii-db-baseactiverecord.html#$oldPrimaryKey-detail">$oldPrimaryKey</a></td>
        <td>mixed</td>
        <td>The old primary key value.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="$primaryKey">
        <td><a href="yii-db-baseactiverecord.html#$primaryKey-detail">$primaryKey</a></td>
        <td>mixed</td>
        <td>The primary key value.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="$relatedRecords">
        <td><a href="yii-db-baseactiverecord.html#$relatedRecords-detail">$relatedRecords</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>An array of related records indexed by relation names.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="$scenario">
        <td><a href="yii-base-model.html#$scenario-detail">$scenario</a></td>
        <td><a href="http://www.php.net/language.types.string">string</a></td>
        <td>The scenario that this model is in.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="$validators">
        <td><a href="yii-base-model.html#$validators-detail">$validators</a></td>
        <td><a href="http://www.php.net/class.arrayobject">ArrayObject</a>|<a href="yii-validators-validator.html">yii\validators\Validator</a>[]</td>
        <td>All the validators declared in the model.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
    </table>
</div>

<a id="methods"></a>

<div class="summary doc-method">
<h2>Public Methods</h2>

<p><a href="#" class="toggle">Hide inherited methods</a></p>

<table class="summary-table table table-striped table-bordered table-hover">
<colgroup>
    <col class="col-method" />
    <col class="col-description" />
    <col class="col-defined" />
</colgroup>
<tr>
  <th>Method</th><th>Description</th><th>Defined By</th>
</tr>
        <tr class="inherited" id="__call()">
        <td><a href="yii-base-object.html#__call()-detail">__call()</a></td>
        <td>Calls the named method which is not a class method.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="__clone()">
        <td><a href="yii-base-component.html#__clone()-detail">__clone()</a></td>
        <td>This method is called after the object is created by cloning an existing one.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="__construct()">
        <td><a href="yii-base-object.html#__construct()-detail">__construct()</a></td>
        <td>Constructor.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr id="__get()">
        <td><a href="yii-db-baseactiverecord.html#__get()-detail">__get()</a></td>
        <td>PHP getter magic method.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="__isset()">
        <td><a href="yii-db-baseactiverecord.html#__isset()-detail">__isset()</a></td>
        <td>Checks if a property value is null.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="__set()">
        <td><a href="yii-db-baseactiverecord.html#__set()-detail">__set()</a></td>
        <td>PHP setter magic method.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="__unset()">
        <td><a href="yii-db-baseactiverecord.html#__unset()-detail">__unset()</a></td>
        <td>Sets a component property to be null.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="activeAttributes()">
        <td><a href="yii-base-model.html#activeAttributes()-detail">activeAttributes()</a></td>
        <td>Returns the attribute names that are subject to validation in the current scenario.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="addError()">
        <td><a href="yii-base-model.html#addError()-detail">addError()</a></td>
        <td>Adds a new error to the specified attribute.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="addErrors()">
        <td><a href="yii-base-model.html#addErrors()-detail">addErrors()</a></td>
        <td>Adds a list of errors.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="afterDelete()">
        <td><a href="yii-db-baseactiverecord.html#afterDelete()-detail">afterDelete()</a></td>
        <td>This method is invoked after deleting a record.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="afterFind()">
        <td><a href="yii-db-baseactiverecord.html#afterFind()-detail">afterFind()</a></td>
        <td>This method is called when the AR object is created and populated with the query result.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="afterRefresh()">
        <td><a href="yii-db-baseactiverecord.html#afterRefresh()-detail">afterRefresh()</a></td>
        <td>This method is called when the AR object is refreshed.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="afterSave()">
        <td><a href="yii-db-baseactiverecord.html#afterSave()-detail">afterSave()</a></td>
        <td>This method is called at the end of inserting or updating a record.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="afterValidate()">
        <td><a href="yii-base-model.html#afterValidate()-detail">afterValidate()</a></td>
        <td>This method is invoked after validation ends.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="attachBehavior()">
        <td><a href="yii-base-component.html#attachBehavior()-detail">attachBehavior()</a></td>
        <td>Attaches a behavior to this component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="attachBehaviors()">
        <td><a href="yii-base-component.html#attachBehaviors()-detail">attachBehaviors()</a></td>
        <td>Attaches a list of behaviors to the component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="attributeHints()">
        <td><a href="yii-base-model.html#attributeHints()-detail">attributeHints()</a></td>
        <td>Returns the attribute hints.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="attributeLabels()">
        <td><a href="yii-base-model.html#attributeLabels()-detail">attributeLabels()</a></td>
        <td>Returns the attribute labels.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="attributes()">
        <td><a href="yii-db-activerecordinterface.html#attributes()-detail">attributes()</a></td>
        <td>Returns the list of all attribute names of the record.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr id="beforeDelete()">
        <td><a href="yii-db-baseactiverecord.html#beforeDelete()-detail">beforeDelete()</a></td>
        <td>This method is invoked before deleting a record.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="beforeSave()">
        <td><a href="yii-db-baseactiverecord.html#beforeSave()-detail">beforeSave()</a></td>
        <td>This method is called at the beginning of inserting or updating a record.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="beforeValidate()">
        <td><a href="yii-base-model.html#beforeValidate()-detail">beforeValidate()</a></td>
        <td>This method is invoked before validation starts.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="behaviors()">
        <td><a href="yii-base-component.html#behaviors()-detail">behaviors()</a></td>
        <td>Returns a list of behaviors that this component should behave as.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="canGetProperty()">
        <td><a href="yii-base-object.html#canGetProperty()-detail">canGetProperty()</a></td>
        <td>Returns a value indicating whether a property can be read.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="canSetProperty()">
        <td><a href="yii-base-object.html#canSetProperty()-detail">canSetProperty()</a></td>
        <td>Returns a value indicating whether a property can be set.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="className()">
        <td><a href="yii-base-object.html#className()-detail">className()</a></td>
        <td>Returns the fully qualified name of this class.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="clearErrors()">
        <td><a href="yii-base-model.html#clearErrors()-detail">clearErrors()</a></td>
        <td>Removes errors for all attributes or a single attribute.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="createValidators()">
        <td><a href="yii-base-model.html#createValidators()-detail">createValidators()</a></td>
        <td>Creates validator objects based on the validation rules specified in <a href="yii-base-model.html#rules()-detail">rules()</a>.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="delete()">
        <td><a href="yii-db-baseactiverecord.html#delete()-detail">delete()</a></td>
        <td>Deletes the table row corresponding to this active record.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="deleteAll()">
        <td><a href="yii-db-baseactiverecord.html#deleteAll()-detail">deleteAll()</a></td>
        <td>Deletes rows in the table using the provided conditions.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="detachBehavior()">
        <td><a href="yii-base-component.html#detachBehavior()-detail">detachBehavior()</a></td>
        <td>Detaches a behavior from the component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="detachBehaviors()">
        <td><a href="yii-base-component.html#detachBehaviors()-detail">detachBehaviors()</a></td>
        <td>Detaches all behaviors from the component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="ensureBehaviors()">
        <td><a href="yii-base-component.html#ensureBehaviors()-detail">ensureBehaviors()</a></td>
        <td>Makes sure that the behaviors declared in <a href="yii-base-component.html#behaviors()-detail">behaviors()</a> are attached to this component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr id="equals()">
        <td><a href="yii-db-baseactiverecord.html#equals()-detail">equals()</a></td>
        <td>Returns a value indicating whether the given active record is the same as the current one.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="extraFields()">
        <td><a href="yii-db-baseactiverecord.html#extraFields()-detail">extraFields()</a></td>
        <td>Returns the list of fields that can be expanded further and returned by <a href="yii-base-arrayabletrait.html#toArray()-detail">toArray()</a>.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="fields()">
        <td><a href="yii-db-baseactiverecord.html#fields()-detail">fields()</a></td>
        <td>Returns the list of fields that should be returned by default by <a href="yii-base-arrayabletrait.html#toArray()-detail">toArray()</a> when no specific fields are specified.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="find()">
        <td><a href="yii-db-activerecordinterface.html#find()-detail">find()</a></td>
        <td>Creates an <a href="yii-db-activequeryinterface.html">yii\db\ActiveQueryInterface</a> instance for query purpose.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr id="findAll()">
        <td><a href="yii-db-baseactiverecord.html#findAll()-detail">findAll()</a></td>
        <td>Returns a list of active record models that match the specified primary key value(s) or a set of column values.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
                <tr id="findOne()">
        <td><a href="yii-db-baseactiverecord.html#findOne()-detail">findOne()</a></td>
        <td>Returns a single active record model instance by a primary key or an array of column values.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="formName()">
        <td><a href="yii-base-model.html#formName()-detail">formName()</a></td>
        <td>Returns the form name that this model class should use.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="generateAttributeLabel()">
        <td><a href="yii-base-model.html#generateAttributeLabel()-detail">generateAttributeLabel()</a></td>
        <td>Generates a user friendly attribute label based on the give attribute name.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="getActiveValidators()">
        <td><a href="yii-base-model.html#getActiveValidators()-detail">getActiveValidators()</a></td>
        <td>Returns the validators applicable to the current <a href="yii-base-model.html#$scenario-detail">$scenario</a>.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="getAttribute()">
        <td><a href="yii-db-baseactiverecord.html#getAttribute()-detail">getAttribute()</a></td>
        <td>Returns the named attribute value.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="getAttributeHint()">
        <td><a href="yii-db-baseactiverecord.html#getAttributeHint()-detail">getAttributeHint()</a></td>
        <td>Returns the text hint for the specified attribute.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="getAttributeLabel()">
        <td><a href="yii-db-baseactiverecord.html#getAttributeLabel()-detail">getAttributeLabel()</a></td>
        <td>Returns the text label for the specified attribute.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="getAttributes()">
        <td><a href="yii-base-model.html#getAttributes()-detail">getAttributes()</a></td>
        <td>Returns attribute values.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="getBehavior()">
        <td><a href="yii-base-component.html#getBehavior()-detail">getBehavior()</a></td>
        <td>Returns the named behavior object.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="getBehaviors()">
        <td><a href="yii-base-component.html#getBehaviors()-detail">getBehaviors()</a></td>
        <td>Returns all behaviors attached to this component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="getDb()">
        <td><a href="yii-db-activerecordinterface.html#getDb()-detail">getDb()</a></td>
        <td>Returns the connection used by this AR class.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr id="getDirtyAttributes()">
        <td><a href="yii-db-baseactiverecord.html#getDirtyAttributes()-detail">getDirtyAttributes()</a></td>
        <td>Returns the attribute values that have been modified since they are loaded or saved most recently.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="getErrors()">
        <td><a href="yii-base-model.html#getErrors()-detail">getErrors()</a></td>
        <td>Returns the errors for all attribute or a single attribute.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="getFirstError()">
        <td><a href="yii-base-model.html#getFirstError()-detail">getFirstError()</a></td>
        <td>Returns the first error of the specified attribute.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="getFirstErrors()">
        <td><a href="yii-base-model.html#getFirstErrors()-detail">getFirstErrors()</a></td>
        <td>Returns the first error of every attribute in the model.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="getIsNewRecord()">
        <td><a href="yii-db-baseactiverecord.html#getIsNewRecord()-detail">getIsNewRecord()</a></td>
        <td>Returns a value indicating whether the current record is new.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="getIterator()">
        <td><a href="yii-base-model.html#getIterator()-detail">getIterator()</a></td>
        <td>Returns an iterator for traversing the attributes in the model.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="getOldAttribute()">
        <td><a href="yii-db-baseactiverecord.html#getOldAttribute()-detail">getOldAttribute()</a></td>
        <td>Returns the old value of the named attribute.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="getOldAttributes()">
        <td><a href="yii-db-baseactiverecord.html#getOldAttributes()-detail">getOldAttributes()</a></td>
        <td>Returns the old attribute values.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="getOldPrimaryKey()">
        <td><a href="yii-db-baseactiverecord.html#getOldPrimaryKey()-detail">getOldPrimaryKey()</a></td>
        <td>Returns the old primary key value(s).</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="getPrimaryKey()">
        <td><a href="yii-db-baseactiverecord.html#getPrimaryKey()-detail">getPrimaryKey()</a></td>
        <td>Returns the primary key value(s).</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="getRelatedRecords()">
        <td><a href="yii-db-baseactiverecord.html#getRelatedRecords()-detail">getRelatedRecords()</a></td>
        <td>Returns all populated related records.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="getRelation()">
        <td><a href="yii-db-baseactiverecord.html#getRelation()-detail">getRelation()</a></td>
        <td>Returns the relation object with the specified name.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="getScenario()">
        <td><a href="yii-base-model.html#getScenario()-detail">getScenario()</a></td>
        <td>Returns the scenario that this model is used in.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="getValidators()">
        <td><a href="yii-base-model.html#getValidators()-detail">getValidators()</a></td>
        <td>Returns all the validators declared in <a href="yii-base-model.html#rules()-detail">rules()</a>.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="hasAttribute()">
        <td><a href="yii-db-baseactiverecord.html#hasAttribute()-detail">hasAttribute()</a></td>
        <td>Returns a value indicating whether the model has an attribute with the specified name.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="hasErrors()">
        <td><a href="yii-base-model.html#hasErrors()-detail">hasErrors()</a></td>
        <td>Returns a value indicating whether there is any validation error.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="hasEventHandlers()">
        <td><a href="yii-base-component.html#hasEventHandlers()-detail">hasEventHandlers()</a></td>
        <td>Returns a value indicating whether there is any handler attached to the named event.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr id="hasMany()">
        <td><a href="yii-db-baseactiverecord.html#hasMany()-detail">hasMany()</a></td>
        <td>Declares a <code>has-many</code> relation.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="hasMethod()">
        <td><a href="yii-base-object.html#hasMethod()-detail">hasMethod()</a></td>
        <td>Returns a value indicating whether a method is defined.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr id="hasOne()">
        <td><a href="yii-db-baseactiverecord.html#hasOne()-detail">hasOne()</a></td>
        <td>Declares a <code>has-one</code> relation.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="hasProperty()">
        <td><a href="yii-base-object.html#hasProperty()-detail">hasProperty()</a></td>
        <td>Returns a value indicating whether a property is defined.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr id="init()">
        <td><a href="yii-db-baseactiverecord.html#init()-detail">init()</a></td>
        <td>Initializes the object.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="insert()">
        <td><a href="yii-db-activerecordinterface.html#insert()-detail">insert()</a></td>
        <td>Inserts the record into the database using the attribute values of this record.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr id="instantiate()">
        <td><a href="yii-db-baseactiverecord.html#instantiate()-detail">instantiate()</a></td>
        <td>Creates an active record instance.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="isAttributeActive()">
        <td><a href="yii-base-model.html#isAttributeActive()-detail">isAttributeActive()</a></td>
        <td>Returns a value indicating whether the attribute is active in the current scenario.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="isAttributeChanged()">
        <td><a href="yii-db-baseactiverecord.html#isAttributeChanged()-detail">isAttributeChanged()</a></td>
        <td>Returns a value indicating whether the named attribute has been changed.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="isAttributeRequired()">
        <td><a href="yii-base-model.html#isAttributeRequired()-detail">isAttributeRequired()</a></td>
        <td>Returns a value indicating whether the attribute is required.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="isAttributeSafe()">
        <td><a href="yii-base-model.html#isAttributeSafe()-detail">isAttributeSafe()</a></td>
        <td>Returns a value indicating whether the attribute is safe for massive assignments.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="isPrimaryKey()">
        <td><a href="yii-db-baseactiverecord.html#isPrimaryKey()-detail">isPrimaryKey()</a></td>
        <td>Returns a value indicating whether the given set of attributes represents the primary key for this model</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="isRelationPopulated()">
        <td><a href="yii-db-baseactiverecord.html#isRelationPopulated()-detail">isRelationPopulated()</a></td>
        <td>Check whether the named relation has been populated with records.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="link()">
        <td><a href="yii-db-baseactiverecord.html#link()-detail">link()</a></td>
        <td>Establishes the relationship between two models.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="load()">
        <td><a href="yii-base-model.html#load()-detail">load()</a></td>
        <td>Populates the model with input data.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="loadMultiple()">
        <td><a href="yii-base-model.html#loadMultiple()-detail">loadMultiple()</a></td>
        <td>Populates a set of models with the data from end user.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="markAttributeDirty()">
        <td><a href="yii-db-baseactiverecord.html#markAttributeDirty()-detail">markAttributeDirty()</a></td>
        <td>Marks an attribute dirty.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="off()">
        <td><a href="yii-base-component.html#off()-detail">off()</a></td>
        <td>Detaches an existing event handler from this component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr id="offsetExists()">
        <td><a href="yii-db-baseactiverecord.html#offsetExists()-detail">offsetExists()</a></td>
        <td>Returns whether there is an element at the specified offset.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="offsetGet()">
        <td><a href="yii-base-model.html#offsetGet()-detail">offsetGet()</a></td>
        <td>Returns the element at the specified offset.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="offsetSet()">
        <td><a href="yii-base-model.html#offsetSet()-detail">offsetSet()</a></td>
        <td>Sets the element at the specified offset.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="offsetUnset()">
        <td><a href="yii-db-baseactiverecord.html#offsetUnset()-detail">offsetUnset()</a></td>
        <td>Sets the element value at the specified offset to null.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="on()">
        <td><a href="yii-base-component.html#on()-detail">on()</a></td>
        <td>Attaches an event handler to an event.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="onUnsafeAttribute()">
        <td><a href="yii-base-model.html#onUnsafeAttribute()-detail">onUnsafeAttribute()</a></td>
        <td>This method is invoked when an unsafe attribute is being massively assigned.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="optimisticLock()">
        <td><a href="yii-db-baseactiverecord.html#optimisticLock()-detail">optimisticLock()</a></td>
        <td>Returns the name of the column that stores the lock version for implementing optimistic locking.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="populateRecord()">
        <td><a href="yii-db-baseactiverecord.html#populateRecord()-detail">populateRecord()</a></td>
        <td>Populates an active record object using a row of data from the database/storage.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="populateRelation()">
        <td><a href="yii-db-baseactiverecord.html#populateRelation()-detail">populateRelation()</a></td>
        <td>Populates the named relation with the related records.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="primaryKey()">
        <td><a href="yii-db-activerecordinterface.html#primaryKey()-detail">primaryKey()</a></td>
        <td>Returns the primary key <strong>name(s)</strong> for this AR class.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr id="refresh()">
        <td><a href="yii-db-baseactiverecord.html#refresh()-detail">refresh()</a></td>
        <td>Repopulates this active record with the latest data.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
                <tr class="inherited" id="rules()">
        <td><a href="yii-base-model.html#rules()-detail">rules()</a></td>
        <td>Returns the validation rules for attributes.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="safeAttributes()">
        <td><a href="yii-base-model.html#safeAttributes()-detail">safeAttributes()</a></td>
        <td>Returns the attribute names that are safe to be massively assigned in the current scenario.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="save()">
        <td><a href="yii-db-baseactiverecord.html#save()-detail">save()</a></td>
        <td>Saves the current record.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="scenarios()">
        <td><a href="yii-base-model.html#scenarios()-detail">scenarios()</a></td>
        <td>Returns a list of scenarios and the corresponding active attributes.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="setAttribute()">
        <td><a href="yii-db-baseactiverecord.html#setAttribute()-detail">setAttribute()</a></td>
        <td>Sets the named attribute value.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="setAttributes()">
        <td><a href="yii-base-model.html#setAttributes()-detail">setAttributes()</a></td>
        <td>Sets the attribute values in a massive way.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="setIsNewRecord()">
        <td><a href="yii-db-baseactiverecord.html#setIsNewRecord()-detail">setIsNewRecord()</a></td>
        <td>Sets the value indicating whether the record is new.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="setOldAttribute()">
        <td><a href="yii-db-baseactiverecord.html#setOldAttribute()-detail">setOldAttribute()</a></td>
        <td>Sets the old value of the named attribute.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="setOldAttributes()">
        <td><a href="yii-db-baseactiverecord.html#setOldAttributes()-detail">setOldAttributes()</a></td>
        <td>Sets the old attribute values.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="setScenario()">
        <td><a href="yii-base-model.html#setScenario()-detail">setScenario()</a></td>
        <td>Sets the scenario for the model.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="toArray()">
        <td><a href="yii-base-arrayabletrait.html#toArray()-detail">toArray()</a></td>
        <td>Converts the model into an array.</td>
        <td><a href="yii-base-arrayabletrait.html">yii\base\ArrayableTrait</a></td>
    </tr>
            <tr class="inherited" id="trigger()">
        <td><a href="yii-base-component.html#trigger()-detail">trigger()</a></td>
        <td>Triggers an event.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr id="unlink()">
        <td><a href="yii-db-baseactiverecord.html#unlink()-detail">unlink()</a></td>
        <td>Destroys the relationship between two models.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="unlinkAll()">
        <td><a href="yii-db-baseactiverecord.html#unlinkAll()-detail">unlinkAll()</a></td>
        <td>Destroys the relationship in current model.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="update()">
        <td><a href="yii-db-baseactiverecord.html#update()-detail">update()</a></td>
        <td>Saves the changes to this active record into the associated database table.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="updateAll()">
        <td><a href="yii-db-baseactiverecord.html#updateAll()-detail">updateAll()</a></td>
        <td>Updates the whole table using the provided attribute values and conditions.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="updateAllCounters()">
        <td><a href="yii-db-baseactiverecord.html#updateAllCounters()-detail">updateAllCounters()</a></td>
        <td>Updates the whole table using the provided counter changes and conditions.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="updateAttributes()">
        <td><a href="yii-db-baseactiverecord.html#updateAttributes()-detail">updateAttributes()</a></td>
        <td>Updates the specified attributes.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="updateCounters()">
        <td><a href="yii-db-baseactiverecord.html#updateCounters()-detail">updateCounters()</a></td>
        <td>Updates one or several counter columns for the current AR object.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
                <tr class="inherited" id="validate()">
        <td><a href="yii-base-model.html#validate()-detail">validate()</a></td>
        <td>Performs the data validation.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="validateMultiple()">
        <td><a href="yii-base-model.html#validateMultiple()-detail">validateMultiple()</a></td>
        <td>Validates multiple models.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
    </table>
</div>

<div class="summary doc-method">
<h2>Protected Methods</h2>

<p><a href="#" class="toggle">Hide inherited methods</a></p>

<table class="summary-table table table-striped table-bordered table-hover">
<colgroup>
    <col class="col-method" />
    <col class="col-description" />
    <col class="col-defined" />
</colgroup>
<tr>
  <th>Method</th><th>Description</th><th>Defined By</th>
</tr>
                                                                                                                                                                    <tr id="findByCondition()">
        <td><a href="yii-db-baseactiverecord.html#findByCondition()-detail">findByCondition()</a></td>
        <td>Finds ActiveRecord instance(s) by the given condition.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
                                                                                                                                                                                                                                                <tr class="inherited" id="resolveFields()">
        <td><a href="yii-base-arrayabletrait.html#resolveFields()-detail">resolveFields()</a></td>
        <td>Determines which fields can be returned by <a href="yii-base-arrayabletrait.html#toArray()-detail">toArray()</a>.</td>
        <td><a href="yii-base-arrayabletrait.html">yii\base\ArrayableTrait</a></td>
    </tr>
                                                                                        <tr id="updateInternal()">
        <td><a href="yii-db-baseactiverecord.html#updateInternal()-detail">updateInternal()</a></td>
        <td></td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            </table>
</div>

<a id="events"></a>
<div class="summary doc-event">
    <h2>Events</h2>

    <p><a href="#" class="toggle">Hide inherited events</a></p>

    <table class="summary-table table table-striped table-bordered table-hover">
    <colgroup>
        <col class="col-event" />
        <col class="col-type" />
        <col class="col-description" />
        <col class="col-defined" />
    </colgroup>
    <tr>
        <th>Event</th><th>Type</th><th>Description</th><th>Defined By</th>
    </tr>
        <tr id="EVENT_AFTER_DELETE">
        <td><a href="yii-db-baseactiverecord.html#EVENT_AFTER_DELETE-detail">EVENT_AFTER_DELETE</a></td>
        <td><a href="yii-base-event.html">yii\base\Event</a></td>
        <td>
            An event that is triggered after a record is deleted.                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        <tr id="EVENT_AFTER_FIND">
        <td><a href="yii-db-baseactiverecord.html#EVENT_AFTER_FIND-detail">EVENT_AFTER_FIND</a></td>
        <td><a href="yii-base-event.html">yii\base\Event</a></td>
        <td>
            An event that is triggered after the record is created and populated with query result.                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        <tr id="EVENT_AFTER_INSERT">
        <td><a href="yii-db-baseactiverecord.html#EVENT_AFTER_INSERT-detail">EVENT_AFTER_INSERT</a></td>
        <td><a href="yii-db-aftersaveevent.html">yii\db\AfterSaveEvent</a></td>
        <td>
            An event that is triggered after a record is inserted.                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        <tr id="EVENT_AFTER_REFRESH">
        <td><a href="yii-db-baseactiverecord.html#EVENT_AFTER_REFRESH-detail">EVENT_AFTER_REFRESH</a></td>
        <td><a href="yii-base-event.html">yii\base\Event</a></td>
        <td>
            An event that is triggered after a record is refreshed.                            (available since version 2.0.8)
                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        <tr id="EVENT_AFTER_UPDATE">
        <td><a href="yii-db-baseactiverecord.html#EVENT_AFTER_UPDATE-detail">EVENT_AFTER_UPDATE</a></td>
        <td><a href="yii-db-aftersaveevent.html">yii\db\AfterSaveEvent</a></td>
        <td>
            An event that is triggered after a record is updated.                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        <tr class="inherited" id="EVENT_AFTER_VALIDATE">
        <td><a href="yii-base-model.html#EVENT_AFTER_VALIDATE-detail">EVENT_AFTER_VALIDATE</a></td>
        <td><a href="yii-base-event.html">yii\base\Event</a></td>
        <td>
            An event raised at the end of <a href="yii-base-model.html#validate()-detail">validate()</a>                    </td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
        <tr id="EVENT_BEFORE_DELETE">
        <td><a href="yii-db-baseactiverecord.html#EVENT_BEFORE_DELETE-detail">EVENT_BEFORE_DELETE</a></td>
        <td><a href="yii-base-modelevent.html">yii\base\ModelEvent</a></td>
        <td>
            An event that is triggered before deleting a record.                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        <tr id="EVENT_BEFORE_INSERT">
        <td><a href="yii-db-baseactiverecord.html#EVENT_BEFORE_INSERT-detail">EVENT_BEFORE_INSERT</a></td>
        <td><a href="yii-base-modelevent.html">yii\base\ModelEvent</a></td>
        <td>
            An event that is triggered before inserting a record.                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        <tr id="EVENT_BEFORE_UPDATE">
        <td><a href="yii-db-baseactiverecord.html#EVENT_BEFORE_UPDATE-detail">EVENT_BEFORE_UPDATE</a></td>
        <td><a href="yii-base-modelevent.html">yii\base\ModelEvent</a></td>
        <td>
            An event that is triggered before updating a record.                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        <tr class="inherited" id="EVENT_BEFORE_VALIDATE">
        <td><a href="yii-base-model.html#EVENT_BEFORE_VALIDATE-detail">EVENT_BEFORE_VALIDATE</a></td>
        <td><a href="yii-base-modelevent.html">yii\base\ModelEvent</a></td>
        <td>
            An event raised at the beginning of <a href="yii-base-model.html#validate()-detail">validate()</a>.                    </td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
        <tr id="EVENT_INIT">
        <td><a href="yii-db-baseactiverecord.html#EVENT_INIT-detail">EVENT_INIT</a></td>
        <td><a href="yii-base-event.html">yii\base\Event</a></td>
        <td>
            An event that is triggered when the record is initialized via <a href="yii-db-baseactiverecord.html#init()-detail">init()</a>.                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        </table>
</div>

<a id="constants"></a>
<div class="summary doc-const">
    <h2>Constants</h2>

    <p><a href="#" class="toggle">Hide inherited constants</a></p>

    <table class="summary-table table table-striped table-bordered table-hover">
    <colgroup>
        <col class="col-const" />
        <col class="col-value" />
        <col class="col-description" />
        <col class="col-defined" />
    </colgroup>
    <tr>
        <th>Constant</th><th>Value</th><th>Description</th><th>Defined By</th>
    </tr>
            <tr class="inherited" id="SCENARIO_DEFAULT">
          <td id="SCENARIO_DEFAULT-detail">SCENARIO_DEFAULT</td>
          <td>'default'</td>
          <td>The name of the default scenario.
</td>
          <td><a href="yii-base-model.html">yii\base\Model</a></td>
        </tr>
        </table>
</div>

<h2>Property Details</h2>

<div class="property-doc">

    <div class="detail-header h3" id="$dirtyAttributes-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#$dirtyAttributes-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $dirtyAttributes        <span class="detail-header-tag small">
            public                         <em>read-only</em>                         property
                    </span>
    </div>

    <div class="doc-description">
        <p>The changed attribute values (name-value pairs)</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-db-baseactiverecord.html#getDirtyAttributes()-detail">getDirtyAttributes</a></strong> ( <span style="color: #0000BB">$names&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span> )</div>


    <div class="detail-header h3" id="$isNewRecord-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#$isNewRecord-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $isNewRecord        <span class="detail-header-tag small">
            public                                                property
                    </span>
    </div>

    <div class="doc-description">
        <p>Whether the record is new and should be inserted when calling <a href="yii-db-baseactiverecord.html#save()-detail">save()</a>.</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-db-baseactiverecord.html#getIsNewRecord()-detail">getIsNewRecord</a></strong> ( )<br /><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-db-baseactiverecord.html#setIsNewRecord()-detail">setIsNewRecord</a></strong> ( <span style="color: #0000BB">$value</span> )</div>


    <div class="detail-header h3" id="$oldAttributes-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#$oldAttributes-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $oldAttributes        <span class="detail-header-tag small">
            public                                                property
                    </span>
    </div>

    <div class="doc-description">
        <p>The old attribute values (name-value pairs)</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-db-baseactiverecord.html#getOldAttributes()-detail">getOldAttributes</a></strong> ( )<br /><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-db-baseactiverecord.html#setOldAttributes()-detail">setOldAttributes</a></strong> ( <span style="color: #0000BB">$values</span> )</div>


    <div class="detail-header h3" id="$oldPrimaryKey-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#$oldPrimaryKey-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $oldPrimaryKey        <span class="detail-header-tag small">
            public                         <em>read-only</em>                         property
                    </span>
    </div>

    <div class="doc-description">
        <p>The old primary key value. An array (column name =&gt; column value) is returned if the primary key
is composite or <code>$asArray</code> is true. A string is returned otherwise (null will be returned if
the key value is null).</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type">mixed</span> <strong><a href="yii-db-baseactiverecord.html#getOldPrimaryKey()-detail">getOldPrimaryKey</a></strong> ( <span style="color: #0000BB">$asArray&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">false</span> )</div>


    <div class="detail-header h3" id="$primaryKey-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#$primaryKey-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $primaryKey        <span class="detail-header-tag small">
            public                         <em>read-only</em>                         property
                    </span>
    </div>

    <div class="doc-description">
        <p>The primary key value. An array (column name =&gt; column value) is returned if the primary key
is composite or <code>$asArray</code> is true. A string is returned otherwise (null will be returned if
the key value is null).</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type">mixed</span> <strong><a href="yii-db-baseactiverecord.html#getPrimaryKey()-detail">getPrimaryKey</a></strong> ( <span style="color: #0000BB">$asArray&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">false</span> )</div>


    <div class="detail-header h3" id="$relatedRecords-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#$relatedRecords-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $relatedRecords        <span class="detail-header-tag small">
            public                         <em>read-only</em>                         property
                    </span>
    </div>

    <div class="doc-description">
        <p>An array of related records indexed by relation names.</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-db-baseactiverecord.html#getRelatedRecords()-detail">getRelatedRecords</a></strong> ( )</div>

</div>
<h2>Method Details</h2>

<div class="method-doc">

    <div class="detail-header h3" id="__get()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#__get()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L242" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L242" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        __get()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>PHP getter magic method.</strong></p>

        <p>This method is overridden so that attributes and related objects can be accessed like properties.</p>

        <p>See also <a href="yii-db-baseactiverecord.html#getAttribute()-detail">getAttribute()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">mixed</span> <strong><a href="yii-db-baseactiverecord.html#__get()-detail">__get</a></strong> ( <span style="color: #0000BB">$name</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$name</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>Property name</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col">mixed</td>
                  <td class="param-desc-col"><p>Property value</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-base-invalidparamexception.html">yii\base\InvalidParamException</a></td>
                  <td class="param-desc-col"><p>if relation name is wrong</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="__isset()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#__isset()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L282" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L282" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        __isset()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Checks if a property value is null.</strong></p>

        <p>This method overrides the parent implementation by checking if the named attribute is null or not.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-db-baseactiverecord.html#__isset()-detail">__isset</a></strong> ( <span style="color: #0000BB">$name</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$name</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The property name or the event name</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether the property value is null</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="__set()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#__set()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L267" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L267" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        __set()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>PHP setter magic method.</strong></p>

        <p>This method is overridden so that AR attributes can be accessed like properties.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-db-baseactiverecord.html#__set()-detail">__set</a></strong> ( <span style="color: #0000BB">$name</span>, <span style="color: #0000BB">$value</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$name</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>Property name</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$value</span></td>
                  <td class="param-type-col">mixed</td>
                  <td class="param-desc-col"><p>Property value</p>
</td>
                </tr>
                                                </table>

<!--	-->

    <div class="detail-header h3" id="__unset()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#__unset()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L297" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L297" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        __unset()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Sets a component property to be null.</strong></p>

        <p>This method overrides the parent implementation by clearing
the specified attribute value.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-db-baseactiverecord.html#__unset()-detail">__unset</a></strong> ( <span style="color: #0000BB">$name</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$name</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The property name or the event name</p>
</td>
                </tr>
                                                </table>

<!--	-->

    <div class="detail-header h3" id="afterDelete()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#afterDelete()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L952" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L952" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        afterDelete()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>This method is invoked after deleting a record.</strong></p>

        <p>The default implementation raises the <a href="yii-db-baseactiverecord.html#EVENT_AFTER_DELETE-detail">EVENT_AFTER_DELETE</a> event.
You may override this method to do postprocessing after the record is deleted.
Make sure you call the parent implementation so that the event is raised properly.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-db-baseactiverecord.html#afterDelete()-detail">afterDelete</a></strong> ( )</td></tr>
            </table>

<!--	-->

    <div class="detail-header h3" id="afterFind()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#afterFind()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L862" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L862" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        afterFind()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>This method is called when the AR object is created and populated with the query result.</strong></p>

        <p>The default implementation will trigger an <a href="yii-db-baseactiverecord.html#EVENT_AFTER_FIND-detail">EVENT_AFTER_FIND</a> event.
When overriding this method, make sure you call the parent implementation to ensure the
event is triggered.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-db-baseactiverecord.html#afterFind()-detail">afterFind</a></strong> ( )</td></tr>
            </table>

<!--	-->

    <div class="detail-header h3" id="afterRefresh()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#afterRefresh()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L990" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L990" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        afterRefresh()
        <span class="detail-header-tag small">
            public                                    method
                            (available since version 2.0.8)
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>This method is called when the AR object is refreshed.</strong></p>

        <p>The default implementation will trigger an <a href="yii-db-baseactiverecord.html#EVENT_AFTER_REFRESH-detail">EVENT_AFTER_REFRESH</a> event.
When overriding this method, make sure you call the parent implementation to ensure the
event is triggered.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-db-baseactiverecord.html#afterRefresh()-detail">afterRefresh</a></strong> ( )</td></tr>
            </table>

<!--	-->

    <div class="detail-header h3" id="afterSave()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#afterSave()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L912" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L912" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        afterSave()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>This method is called at the end of inserting or updating a record.</strong></p>

        <p>The default implementation will trigger an <a href="yii-db-baseactiverecord.html#EVENT_AFTER_INSERT-detail">EVENT_AFTER_INSERT</a> event when <code>$insert</code> is true,
or an <a href="yii-db-baseactiverecord.html#EVENT_AFTER_UPDATE-detail">EVENT_AFTER_UPDATE</a> event if <code>$insert</code> is false. The event class used is <a href="yii-db-aftersaveevent.html">yii\db\AfterSaveEvent</a>.
When overriding this method, make sure you call the parent implementation so that
the event is triggered.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-db-baseactiverecord.html#afterSave()-detail">afterSave</a></strong> ( <span style="color: #0000BB">$insert</span>, <span style="color: #0000BB">$changedAttributes</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$insert</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether this method called while inserting a record.
If false, it means the method is called while updating a record.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$changedAttributes</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The old values of attributes that had changed and were saved.
You can use this parameter to take action based on the changes made for example send an email
when the password had changed or implement audit trail that tracks all the changes.
<code>$changedAttributes</code> gives you the old attribute values while the active record (<code>$this</code>) has
already the new, updated values.</p>
</td>
                </tr>
                                                </table>

<!--	-->

    <div class="detail-header h3" id="beforeDelete()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#beforeDelete()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L938" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L938" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        beforeDelete()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>This method is invoked before deleting a record.</strong></p>

        <p>The default implementation raises the <a href="yii-db-baseactiverecord.html#EVENT_BEFORE_DELETE-detail">EVENT_BEFORE_DELETE</a> event.
When overriding this method, make sure you call the parent implementation like the following:</p>
<pre><code class="hljs php language-php"><span class="hljs-keyword">public</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">beforeDelete</span><span class="hljs-params">()</span>
</span>{
    <span class="hljs-keyword">if</span> (<span class="hljs-keyword">parent</span>::beforeDelete()) {
        <span class="hljs-comment">// ...custom code here...</span>
        <span class="hljs-keyword">return</span> <span class="hljs-keyword">true</span>;
    } <span class="hljs-keyword">else</span> {
        <span class="hljs-keyword">return</span> <span class="hljs-keyword">false</span>;
    }
}
</code></pre>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-db-baseactiverecord.html#beforeDelete()-detail">beforeDelete</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether the record should be deleted. Defaults to true.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="beforeSave()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#beforeSave()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L890" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L890" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        beforeSave()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>This method is called at the beginning of inserting or updating a record.</strong></p>

        <p>The default implementation will trigger an <a href="yii-db-baseactiverecord.html#EVENT_BEFORE_INSERT-detail">EVENT_BEFORE_INSERT</a> event when <code>$insert</code> is true,
or an <a href="yii-db-baseactiverecord.html#EVENT_BEFORE_UPDATE-detail">EVENT_BEFORE_UPDATE</a> event if <code>$insert</code> is false.
When overriding this method, make sure you call the parent implementation like the following:</p>
<pre><code class="hljs php language-php"><span class="hljs-keyword">public</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">beforeSave</span><span class="hljs-params">(<span class="hljs-variable">$insert</span>)</span>
</span>{
    <span class="hljs-keyword">if</span> (<span class="hljs-keyword">parent</span>::beforeSave(<span class="hljs-variable">$insert</span>)) {
        <span class="hljs-comment">// ...custom code here...</span>
        <span class="hljs-keyword">return</span> <span class="hljs-keyword">true</span>;
    } <span class="hljs-keyword">else</span> {
        <span class="hljs-keyword">return</span> <span class="hljs-keyword">false</span>;
    }
}
</code></pre>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-db-baseactiverecord.html#beforeSave()-detail">beforeSave</a></strong> ( <span style="color: #0000BB">$insert</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$insert</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether this method called while inserting a record.
If false, it means the method is called while updating a record.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether the insertion or updating should continue.
If false, the insertion or updating will be cancelled.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="delete()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#delete()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L802" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L802" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        delete()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Deletes the table row corresponding to this active record.</strong></p>

        <p>This method performs the following steps in order:</p>
<ol>
<li>call <a href="yii-db-baseactiverecord.html#beforeDelete()-detail">beforeDelete()</a>. If the method returns false, it will skip the
rest of the steps;</li>
<li>delete the record from the database;</li>
<li>call <a href="yii-db-baseactiverecord.html#afterDelete()-detail">afterDelete()</a>.</li>
</ol>
<p>In the above step 1 and 3, events named <a href="yii-db-baseactiverecord.html#EVENT_BEFORE_DELETE-detail">EVENT_BEFORE_DELETE</a> and <a href="yii-db-baseactiverecord.html#EVENT_AFTER_DELETE-detail">EVENT_AFTER_DELETE</a>
will be raised by the corresponding methods.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.integer">integer</a>|<a href="http://www.php.net/language.types.boolean">false</a></span> <strong><a href="yii-db-baseactiverecord.html#delete()-detail">delete</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.integer">integer</a>|<a href="http://www.php.net/language.types.boolean">false</a></td>
                  <td class="param-desc-col"><p>The number of rows deleted, or false if the deletion is unsuccessful for some reason.
Note that it is possible the number of rows deleted is 0, even though the deletion execution is successful.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-db-staleobjectexception.html">yii\db\StaleObjectException</a></td>
                  <td class="param-desc-col"><p>if <a href="yii-db-baseactiverecord.html#optimisticLock()-detail">optimistic locking</a> is enabled and the data
being deleted is outdated.</p>
</td>
                </tr>
                            <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-db-exception.html">yii\db\Exception</a></td>
                  <td class="param-desc-col"><p>in case delete failed.</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="deleteAll()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#deleteAll()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L199" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L199" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        deleteAll()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Deletes rows in the table using the provided conditions.</strong></p>

        <p>WARNING: If you do not specify any condition, this method will delete ALL rows in the table.</p>
<p>For example, to delete all customers whose status is 3:</p>
<pre><code class="hljs php language-php">Customer::deleteAll(<span class="hljs-string">'status = 3'</span>);
</code></pre>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type"><a href="http://www.php.net/language.types.integer">integer</a></span> <strong><a href="yii-db-baseactiverecord.html#deleteAll()-detail">deleteAll</a></strong> ( <span style="color: #0000BB">$condition&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">''</span>, <span style="color: #0000BB">$params&nbsp;</span><span style="color: #007700">=&nbsp;[]</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$condition</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a>|<a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The conditions that will be put in the WHERE part of the DELETE SQL.
Please refer to <a href="yii-db-query.html#where()-detail">yii\db\Query::where()</a> on how to specify this parameter.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$params</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The parameters (name =&gt; value) to be bound to the query.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.integer">integer</a></td>
                  <td class="param-desc-col"><p>The number of rows deleted</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-base-notsupportedexception.html">yii\base\NotSupportedException</a></td>
                  <td class="param-desc-col"><p>if not overrided</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="equals()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#equals()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L1002" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L1002" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        equals()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns a value indicating whether the given active record is the same as the current one.</strong></p>

        <p>The comparison is made by comparing the table names and the primary key values of the two active records.
If one of the records <a href="yii-db-baseactiverecord.html#$isNewRecord-detail">is new</a> they are also considered not equal.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-db-baseactiverecord.html#equals()-detail">equals</a></strong> ( <span style="color: #0000BB">$record</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$record</span></td>
                  <td class="param-type-col"><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
                  <td class="param-desc-col"><p>Record to compare to</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether the two active records refer to the same row in the same database table.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="extraFields()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#extraFields()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L1583" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L1583" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        extraFields()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the list of fields that can be expanded further and returned by <a href="yii-base-arrayabletrait.html#toArray()-detail">toArray()</a>.</strong></p>

        <p>This method is similar to <a href="yii-db-baseactiverecord.html#fields()-detail">fields()</a> except that the list of fields returned
by this method are not returned by default by <a href="yii-base-arrayabletrait.html#toArray()-detail">toArray()</a>. Only when field names
to be expanded are explicitly specified when calling <a href="yii-base-arrayabletrait.html#toArray()-detail">toArray()</a>, will their values
be exported.</p>
<p>The default implementation returns an empty array.</p>
<p>You may override this method to return a list of expandable fields based on some context information
(e.g. the current application user).</p>
<p>The default implementation returns the names of the relations that have been populated into this record.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-db-baseactiverecord.html#extraFields()-detail">extraFields</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The list of expandable field names or field definitions. Please refer
to <a href="yii-db-baseactiverecord.html#fields()-detail">fields()</a> on the format of the return value.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="fields()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#fields()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L1571" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L1571" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        fields()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the list of fields that should be returned by default by <a href="yii-base-arrayabletrait.html#toArray()-detail">toArray()</a> when no specific fields are specified.</strong></p>

        <p>A field is a named element in the returned array by <a href="yii-base-arrayabletrait.html#toArray()-detail">toArray()</a>.</p>
<p>This method should return an array of field names or field definitions.
If the former, the field name will be treated as an object property name whose value will be used
as the field value. If the latter, the array key should be the field name while the array value should be
the corresponding field definition which can be either an object property name or a PHP callable
returning the corresponding field value. The signature of the callable should be:</p>
<pre><code class="hljs php language-php"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-params">(<span class="hljs-variable">$model</span>, <span class="hljs-variable">$field</span>)</span> </span>{
    <span class="hljs-comment">// return field value</span>
}
</code></pre>
<p>For example, the following code declares four fields:</p>
<ul>
<li><code>email</code>: the field name is the same as the property name <code>email</code>;</li>
<li><code>firstName</code> and <code>lastName</code>: the field names are <code>firstName</code> and <code>lastName</code>, and their
values are obtained from the <code>first_name</code> and <code>last_name</code> properties;</li>
<li><code>fullName</code>: the field name is <code>fullName</code>. Its value is obtained by concatenating <code>first_name</code>
and <code>last_name</code>.</li>
</ul>
<pre><code class="hljs php language-php"><span class="hljs-keyword">return</span> [
    <span class="hljs-string">'email'</span>,
    <span class="hljs-string">'firstName'</span> =&gt; <span class="hljs-string">'first_name'</span>,
    <span class="hljs-string">'lastName'</span> =&gt; <span class="hljs-string">'last_name'</span>,
    <span class="hljs-string">'fullName'</span> =&gt; <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-params">(<span class="hljs-variable">$model</span>)</span> </span>{
        <span class="hljs-keyword">return</span> <span class="hljs-variable">$model</span>-&gt;first_name . <span class="hljs-string">' '</span> . <span class="hljs-variable">$model</span>-&gt;last_name;
    },
];
</code></pre>
<p>In this method, you may also want to return different lists of fields based on some context
information. For example, depending on <a href="yii-base-model.html#$scenario-detail">$scenario</a> or the privilege of the current application user,
you may return different sets of visible fields or filter out some fields.</p>
<p>The default implementation of this method returns <a href="yii-db-activerecordinterface.html#attributes()-detail">attributes()</a> indexed by the same attribute names.</p>
<p>The default implementation returns the names of the columns whose values have been populated into this record.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-db-baseactiverecord.html#fields()-detail">fields</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The list of field names or field definitions.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="findAll()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#findAll()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L114" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L114" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        findAll()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns a list of active record models that match the specified primary key value(s) or a set of column values.</strong></p>

        <p>The method accepts:</p>
<ul>
<li>a scalar value (integer or string): query by a single primary key value and return an array containing the
corresponding record (or an empty array if not found).</li>
<li>a non-associative array: query by a list of primary key values and return the
corresponding records (or an empty array if none was found).
Note that an empty condition will result in an empty result as it will be interpreted as a search for
primary keys and not an empty <code>WHERE</code> condition.</li>
<li>an associative array of name-value pairs: query by a set of attribute values and return an array of records
matching all of them (or an empty array if none was found). Note that <code>['id' =&gt; 1, 2]</code> is treated as
a non-associative array.</li>
</ul>
<p>This method will automatically call the <code>all()</code> method and return an array of <a href="yii-db-activerecordinterface.html">ActiveRecord</a>
instances. For example,</p>
<pre><code class="hljs php language-php"><span class="hljs-comment">// find the customers whose primary key value is 10</span>
<span class="hljs-variable">$customers</span> = Customer::findAll(<span class="hljs-number">10</span>);

<span class="hljs-comment">// the above code is equivalent to:</span>
<span class="hljs-variable">$customers</span> = Customer::find()-&gt;where([<span class="hljs-string">'id'</span> =&gt; <span class="hljs-number">10</span>])-&gt;all();

<span class="hljs-comment">// find the customers whose primary key value is 10, 11 or 12.</span>
<span class="hljs-variable">$customers</span> = Customer::findAll([<span class="hljs-number">10</span>, <span class="hljs-number">11</span>, <span class="hljs-number">12</span>]);

<span class="hljs-comment">// the above code is equivalent to:</span>
<span class="hljs-variable">$customers</span> = Customer::find()-&gt;where([<span class="hljs-string">'id'</span> =&gt; [<span class="hljs-number">10</span>, <span class="hljs-number">11</span>, <span class="hljs-number">12</span>]])-&gt;all();

<span class="hljs-comment">// find customers whose age is 30 and whose status is 1</span>
<span class="hljs-variable">$customers</span> = Customer::findAll([<span class="hljs-string">'age'</span> =&gt; <span class="hljs-number">30</span>, <span class="hljs-string">'status'</span> =&gt; <span class="hljs-number">1</span>]);

<span class="hljs-comment">// the above code is equivalent to:</span>
<span class="hljs-variable">$customers</span> = Customer::find()-&gt;where([<span class="hljs-string">'age'</span> =&gt; <span class="hljs-number">30</span>, <span class="hljs-string">'status'</span> =&gt; <span class="hljs-number">1</span>])-&gt;all();
</code></pre>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type">static[]</span> <strong><a href="yii-db-baseactiverecord.html#findAll()-detail">findAll</a></strong> ( <span style="color: #0000BB">$condition</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$condition</span></td>
                  <td class="param-type-col">mixed</td>
                  <td class="param-desc-col"><p>Primary key value or a set of column values</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col">static[]</td>
                  <td class="param-desc-col"><p>An array of ActiveRecord instances, or an empty array if nothing matches.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="findByCondition()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#findByCondition()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L127" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L127" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        findByCondition()
        <span class="detail-header-tag small">
            protected                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Finds ActiveRecord instance(s) by the given condition.</strong></p>

        <p>This method is internally called by <a href="yii-db-baseactiverecord.html#findOne()-detail">findOne()</a> and <a href="yii-db-baseactiverecord.html#findAll()-detail">findAll()</a>.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">protected static</span> <span class="signature-type"><a href="yii-db-activequeryinterface.html">yii\db\ActiveQueryInterface</a></span> <strong><a href="yii-db-baseactiverecord.html#findByCondition()-detail">findByCondition</a></strong> ( <span style="color: #0000BB">$condition</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$condition</span></td>
                  <td class="param-type-col">mixed</td>
                  <td class="param-desc-col"><p>Please refer to <a href="yii-db-baseactiverecord.html#findOne()-detail">findOne()</a> for the explanation of this parameter</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-db-activequeryinterface.html">yii\db\ActiveQueryInterface</a></td>
                  <td class="param-desc-col"><p>The newly created <a href="yii-db-activequeryinterface.html">ActiveQuery</a> instance.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-base-invalidconfigexception.html">yii\base\InvalidConfigException</a></td>
                  <td class="param-desc-col"><p>if there is no primary key defined</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="findOne()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#findOne()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L105" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L105" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        findOne()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns a single active record model instance by a primary key or an array of column values.</strong></p>

        <p>The method accepts:</p>
<ul>
<li>a scalar value (integer or string): query by a single primary key value and return the
corresponding record (or null if not found).</li>
<li>a non-associative array: query by a list of primary key values and return the
first record (or null if not found).</li>
<li>an associative array of name-value pairs: query by a set of attribute values and return a single record
matching all of them (or null if not found). Note that <code>['id' =&gt; 1, 2]</code> is treated as a non-associative array.</li>
</ul>
<p>That this method will automatically call the <code>one()</code> method and return an <a href="yii-db-activerecordinterface.html">ActiveRecord</a>
instance. For example,</p>
<pre><code class="hljs php language-php"><span class="hljs-comment">// find a single customer whose primary key value is 10</span>
<span class="hljs-variable">$customer</span> = Customer::findOne(<span class="hljs-number">10</span>);

<span class="hljs-comment">// the above code is equivalent to:</span>
<span class="hljs-variable">$customer</span> = Customer::find()-&gt;where([<span class="hljs-string">'id'</span> =&gt; <span class="hljs-number">10</span>])-&gt;one();

<span class="hljs-comment">// find the first customer whose age is 30 and whose status is 1</span>
<span class="hljs-variable">$customer</span> = Customer::findOne([<span class="hljs-string">'age'</span> =&gt; <span class="hljs-number">30</span>, <span class="hljs-string">'status'</span> =&gt; <span class="hljs-number">1</span>]);

<span class="hljs-comment">// the above code is equivalent to:</span>
<span class="hljs-variable">$customer</span> = Customer::find()-&gt;where([<span class="hljs-string">'age'</span> =&gt; <span class="hljs-number">30</span>, <span class="hljs-string">'status'</span> =&gt; <span class="hljs-number">1</span>])-&gt;one();
</code></pre>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type">static|<a href="http://www.php.net/language.types.null">null</a></span> <strong><a href="yii-db-baseactiverecord.html#findOne()-detail">findOne</a></strong> ( <span style="color: #0000BB">$condition</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$condition</span></td>
                  <td class="param-type-col">mixed</td>
                  <td class="param-desc-col"><p>Primary key value or a set of column values</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col">static|<a href="http://www.php.net/language.types.null">null</a></td>
                  <td class="param-desc-col"><p>ActiveRecord instance matching the condition, or <code>null</code> if nothing matches.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getAttribute()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#getAttribute()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L438" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L438" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getAttribute()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the named attribute value.</strong></p>

        <p>If this record is the result of a query and the attribute is not loaded,
null will be returned.</p>

        <p>See also <a href="yii-db-baseactiverecord.html#hasAttribute()-detail">hasAttribute()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">mixed</span> <strong><a href="yii-db-baseactiverecord.html#getAttribute()-detail">getAttribute</a></strong> ( <span style="color: #0000BB">$name</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$name</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The attribute name</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col">mixed</td>
                  <td class="param-desc-col"><p>The attribute value. Null if the attribute is not set or does not exist.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getAttributeHint()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#getAttributeHint()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L1535" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L1535" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getAttributeHint()
        <span class="detail-header-tag small">
            public                                    method
                            (available since version 2.0.4)
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the text hint for the specified attribute.</strong></p>

        <p>If the attribute looks like <code>relatedModel.attribute</code>, then the attribute will be received from the related model.</p>

        <p>See also <a href="yii-base-model.html#attributeHints()-detail">attributeHints()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.string">string</a></span> <strong><a href="yii-db-baseactiverecord.html#getAttributeHint()-detail">getAttributeHint</a></strong> ( <span style="color: #0000BB">$attribute</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$attribute</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The attribute name</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The attribute hint</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getAttributeLabel()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#getAttributeLabel()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L1495" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L1495" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getAttributeLabel()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the text label for the specified attribute.</strong></p>

        <p>If the attribute looks like <code>relatedModel.attribute</code>, then the attribute will be received from the related model.</p>

        <p>See also:</p><ul><li><a href="yii-base-model.html#generateAttributeLabel()-detail">generateAttributeLabel()</a></li><li><a href="yii-base-model.html#attributeLabels()-detail">attributeLabels()</a></li></ul>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.string">string</a></span> <strong><a href="yii-db-baseactiverecord.html#getAttributeLabel()-detail">getAttributeLabel</a></strong> ( <span style="color: #0000BB">$attribute</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$attribute</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The attribute name</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The attribute label</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getDirtyAttributes()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#getDirtyAttributes()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L550" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L550" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getDirtyAttributes()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the attribute values that have been modified since they are loaded or saved most recently.</strong></p>

        <p>The comparison of new and old values is made for identical values using <code>===</code>.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-db-baseactiverecord.html#getDirtyAttributes()-detail">getDirtyAttributes</a></strong> ( <span style="color: #0000BB">$names&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$names</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a>[]|<a href="http://www.php.net/language.types.null">null</a></td>
                  <td class="param-desc-col"><p>The names of the attributes whose values may be returned if they are
changed recently. If null, <a href="yii-db-activerecordinterface.html#attributes()-detail">attributes()</a> will be used.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The changed attribute values (name-value pairs)</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getIsNewRecord()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#getIsNewRecord()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L828" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L828" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getIsNewRecord()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns a value indicating whether the current record is new.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-db-baseactiverecord.html#getIsNewRecord()-detail">getIsNewRecord</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether the record is new and should be inserted when calling <a href="yii-db-baseactiverecord.html#save()-detail">save()</a>.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getOldAttribute()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#getOldAttribute()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L488" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L488" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getOldAttribute()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the old value of the named attribute.</strong></p>

        <p>If this record is the result of a query and the attribute is not loaded,
null will be returned.</p>

        <p>See also <a href="yii-db-baseactiverecord.html#hasAttribute()-detail">hasAttribute()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">mixed</span> <strong><a href="yii-db-baseactiverecord.html#getOldAttribute()-detail">getOldAttribute</a></strong> ( <span style="color: #0000BB">$name</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$name</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The attribute name</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col">mixed</td>
                  <td class="param-desc-col"><p>The old attribute value. Null if the attribute is not loaded before
or does not exist.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getOldAttributes()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#getOldAttributes()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L463" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L463" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getOldAttributes()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the old attribute values.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-db-baseactiverecord.html#getOldAttributes()-detail">getOldAttributes</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The old attribute values (name-value pairs)</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getOldPrimaryKey()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#getOldPrimaryKey()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L1054" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L1054" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getOldPrimaryKey()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the old primary key value(s).</strong></p>

        <p>This refers to the primary key value that is populated into the record
after executing a find method (e.g. find(), findOne()).
The value remains unchanged even if the primary key attribute is manually assigned with a different value.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">mixed</span> <strong><a href="yii-db-baseactiverecord.html#getOldPrimaryKey()-detail">getOldPrimaryKey</a></strong> ( <span style="color: #0000BB">$asArray&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">false</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$asArray</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether to return the primary key value as an array. If true,
the return value will be an array with column name as key and column value as value.
If this is false (default), a scalar value will be returned for non-composite primary key.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col">mixed</td>
                  <td class="param-desc-col"><p>The old primary key value. An array (column name =&gt; column value) is returned if the primary key
is composite or <code>$asArray</code> is true. A string is returned otherwise (null will be returned if
the key value is null).</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-db-exception.html">yii\db\Exception</a></td>
                  <td class="param-desc-col"><p>if the AR model does not have a primary key</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="getPrimaryKey()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#getPrimaryKey()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L1023" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L1023" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getPrimaryKey()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the primary key value(s).</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">mixed</span> <strong><a href="yii-db-baseactiverecord.html#getPrimaryKey()-detail">getPrimaryKey</a></strong> ( <span style="color: #0000BB">$asArray&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">false</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$asArray</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether to return the primary key value as an array. If true,
the return value will be an array with column names as keys and column values as values.
Note that for composite primary keys, an array will always be returned regardless of this parameter value.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col">mixed</td>
                  <td class="param-desc-col"><p>The primary key value. An array (column name =&gt; column value) is returned if the primary key
is composite or <code>$asArray</code> is true. A string is returned otherwise (null will be returned if
the key value is null).</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getRelatedRecords()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#getRelatedRecords()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L415" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L415" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getRelatedRecords()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns all populated related records.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-db-baseactiverecord.html#getRelatedRecords()-detail">getRelatedRecords</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>An array of related records indexed by relation names.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getRelation()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#getRelation()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L1138" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L1138" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getRelation()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the relation object with the specified name.</strong></p>

        <p>A relation is defined by a getter method which returns an <a href="yii-db-activequeryinterface.html">yii\db\ActiveQueryInterface</a> object.
It can be declared in either the Active Record class itself or one of its behaviors.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-db-activequeryinterface.html">yii\db\ActiveQueryInterface</a>|<a href="yii-db-activequery.html">yii\db\ActiveQuery</a></span> <strong><a href="yii-db-baseactiverecord.html#getRelation()-detail">getRelation</a></strong> ( <span style="color: #0000BB">$name</span>, <span style="color: #0000BB">$throwException&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">true</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$name</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The relation name</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$throwException</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether to throw exception if the relation does not exist.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-db-activequeryinterface.html">yii\db\ActiveQueryInterface</a>|<a href="yii-db-activequery.html">yii\db\ActiveQuery</a></td>
                  <td class="param-desc-col"><p>The relational query object. If the relation does not exist
and <code>$throwException</code> is false, null will be returned.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-base-invalidparamexception.html">yii\base\InvalidParamException</a></td>
                  <td class="param-desc-col"><p>if the named relation does not exist.</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="hasAttribute()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#hasAttribute()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L425" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L425" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        hasAttribute()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns a value indicating whether the model has an attribute with the specified name.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-db-baseactiverecord.html#hasAttribute()-detail">hasAttribute</a></strong> ( <span style="color: #0000BB">$name</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$name</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The name of the attribute</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether the model has an attribute with the specified name.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="hasMany()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#hasMany()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L379" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L379" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        hasMany()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Declares a <code>has-many</code> relation.</strong></p>

        <p>The declaration is returned in terms of a relational <a href="yii-db-activequery.html">yii\db\ActiveQuery</a> instance
through which the related record can be queried and retrieved back.</p>
<p>A <code>has-many</code> relation means that there are multiple related records matching
the criteria set by this relation, e.g., a customer has many orders.</p>
<p>For example, to declare the <code>orders</code> relation for <code>Customer</code> class, we can write
the following code in the <code>Customer</code> class:</p>
<pre><code class="hljs php language-php"><span class="hljs-keyword">public</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getOrders</span><span class="hljs-params">()</span>
</span>{
    <span class="hljs-keyword">return</span> <span class="hljs-variable">$this</span>-&gt;hasMany(Order::className(), [<span class="hljs-string">'customer_id'</span> =&gt; <span class="hljs-string">'id'</span>]);
}
</code></pre>
<p>Note that in the above, the 'customer_id' key in the <code>$link</code> parameter refers to
an attribute name in the related class <code>Order</code>, while the 'id' value refers to
an attribute name in the current AR class.</p>
<p>Call methods declared in <a href="yii-db-activequery.html">yii\db\ActiveQuery</a> to further customize the relation.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-db-activequeryinterface.html">yii\db\ActiveQueryInterface</a></span> <strong><a href="yii-db-baseactiverecord.html#hasMany()-detail">hasMany</a></strong> ( <span style="color: #0000BB">$class</span>, <span style="color: #0000BB">$link</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$class</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The class name of the related record</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$link</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The primary-foreign key constraint. The keys of the array refer to
the attributes of the record associated with the <code>$class</code> model, while the values of the
array refer to the corresponding attributes in <strong>this</strong> AR class.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-db-activequeryinterface.html">yii\db\ActiveQueryInterface</a></td>
                  <td class="param-desc-col"><p>The relational query object.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="hasOne()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#hasOne()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L338" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L338" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        hasOne()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Declares a <code>has-one</code> relation.</strong></p>

        <p>The declaration is returned in terms of a relational <a href="yii-db-activequery.html">yii\db\ActiveQuery</a> instance
through which the related record can be queried and retrieved back.</p>
<p>A <code>has-one</code> relation means that there is at most one related record matching
the criteria set by this relation, e.g., a customer has one country.</p>
<p>For example, to declare the <code>country</code> relation for <code>Customer</code> class, we can write
the following code in the <code>Customer</code> class:</p>
<pre><code class="hljs php language-php"><span class="hljs-keyword">public</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getCountry</span><span class="hljs-params">()</span>
</span>{
    <span class="hljs-keyword">return</span> <span class="hljs-variable">$this</span>-&gt;hasOne(Country::className(), [<span class="hljs-string">'id'</span> =&gt; <span class="hljs-string">'country_id'</span>]);
}
</code></pre>
<p>Note that in the above, the 'id' key in the <code>$link</code> parameter refers to an attribute name
in the related class <code>Country</code>, while the 'country_id' value refers to an attribute name
in the current AR class.</p>
<p>Call methods declared in <a href="yii-db-activequery.html">yii\db\ActiveQuery</a> to further customize the relation.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-db-activequeryinterface.html">yii\db\ActiveQueryInterface</a></span> <strong><a href="yii-db-baseactiverecord.html#hasOne()-detail">hasOne</a></strong> ( <span style="color: #0000BB">$class</span>, <span style="color: #0000BB">$link</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$class</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The class name of the related record</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$link</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The primary-foreign key constraint. The keys of the array refer to
the attributes of the record associated with the <code>$class</code> model, while the values of the
array refer to the corresponding attributes in <strong>this</strong> AR class.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-db-activequeryinterface.html">yii\db\ActiveQueryInterface</a></td>
                  <td class="param-desc-col"><p>The relational query object.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="init()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#init()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L850" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L850" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        init()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Initializes the object.</strong></p>

        <p>This method is called at the end of the constructor.
The default implementation will trigger an <a href="yii-db-baseactiverecord.html#EVENT_INIT-detail">EVENT_INIT</a> event.
If you override this method, make sure you call the parent implementation at the end
to ensure triggering of the event.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-db-baseactiverecord.html#init()-detail">init</a></strong> ( )</td></tr>
            </table>

<!--	-->

    <div class="detail-header h3" id="instantiate()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#instantiate()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L1112" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L1112" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        instantiate()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Creates an active record instance.</strong></p>

        <p>This method is called together with <a href="yii-db-baseactiverecord.html#populateRecord()-detail">populateRecord()</a> by <a href="yii-db-activequery.html">yii\db\ActiveQuery</a>.
It is not meant to be used for creating new records directly.</p>
<p>You may override this method if the instance being created
depends on the row data to be populated into the record.
For example, by creating a record based on the value of a column,
you may implement the so-called single-table inheritance mapping.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type">static</span> <strong><a href="yii-db-baseactiverecord.html#instantiate()-detail">instantiate</a></strong> ( <span style="color: #0000BB">$row</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$row</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Row data to be populated into the record.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col">static</td>
                  <td class="param-desc-col"><p>The newly created active record</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="isAttributeChanged()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#isAttributeChanged()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L528" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L528" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        isAttributeChanged()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns a value indicating whether the named attribute has been changed.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-db-baseactiverecord.html#isAttributeChanged()-detail">isAttributeChanged</a></strong> ( <span style="color: #0000BB">$name</span>, <span style="color: #0000BB">$identical&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">true</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$name</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The name of the attribute.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$identical</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether the comparison of new and old value is made for
identical values using <code>===</code>, defaults to <code>true</code>. Otherwise <code>==</code> is used for comparison.
This parameter is available since version 2.0.4.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether the attribute has been changed</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="isPrimaryKey()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#isPrimaryKey()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L1477" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L1477" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        isPrimaryKey()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns a value indicating whether the given set of attributes represents the primary key for this model</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-db-baseactiverecord.html#isPrimaryKey()-detail">isPrimaryKey</a></strong> ( <span style="color: #0000BB">$keys</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$keys</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The set of attributes to check</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether the given set of attributes represents the primary key for this model</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="isRelationPopulated()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#isRelationPopulated()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L406" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L406" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        isRelationPopulated()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Check whether the named relation has been populated with records.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-db-baseactiverecord.html#isRelationPopulated()-detail">isRelationPopulated</a></strong> ( <span style="color: #0000BB">$name</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$name</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The relation name (case-sensitive)</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether relation has been populated with records.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="link()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#link()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L1194" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L1194" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        link()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Establishes the relationship between two models.</strong></p>

        <p>The relationship is established by setting the foreign key value(s) in one model
to be the corresponding primary key value(s) in the other model.
The model with the foreign key will be saved into database without performing validation.</p>
<p>If the relationship involves a junction table, a new row will be inserted into the
junction table which contains the primary key values from both models.</p>
<p>Note that this method requires that the primary key value is not null.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-db-baseactiverecord.html#link()-detail">link</a></strong> ( <span style="color: #0000BB">$name</span>, <span style="color: #0000BB">$model</span>, <span style="color: #0000BB">$extraColumns&nbsp;</span><span style="color: #007700">=&nbsp;[]</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$name</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The case sensitive name of the relationship.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$model</span></td>
                  <td class="param-type-col"><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
                  <td class="param-desc-col"><p>The model to be linked with the current one.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$extraColumns</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Additional column values to be saved into the junction table.
This parameter is only meaningful for a relationship involving a junction table
(i.e., a relation set with <a href="yii-db-activerelationtrait.html#via()-detail">yii\db\ActiveRelationTrait::via()</a> or <a href="yii-db-activequery.html#viaTable()-detail">yii\db\ActiveQuery::viaTable()</a>.)</p>
</td>
                </tr>
                                                    <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-base-invalidcallexception.html">yii\base\InvalidCallException</a></td>
                  <td class="param-desc-col"><p>if the method is unable to link two models.</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="markAttributeDirty()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#markAttributeDirty()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L515" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L515" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        markAttributeDirty()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Marks an attribute dirty.</strong></p>

        <p>This method may be called to force updating a record when calling <a href="yii-db-baseactiverecord.html#update()-detail">update()</a>,
even if there is no change being made to the record.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-db-baseactiverecord.html#markAttributeDirty()-detail">markAttributeDirty</a></strong> ( <span style="color: #0000BB">$name</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$name</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The attribute name</p>
</td>
                </tr>
                                                </table>

<!--	-->

    <div class="detail-header h3" id="offsetExists()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#offsetExists()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L1123" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L1123" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        offsetExists()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns whether there is an element at the specified offset.</strong></p>

        <p>This method is required by the interface <a href="http://www.php.net/class.arrayaccess">ArrayAccess</a>.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-db-baseactiverecord.html#offsetExists()-detail">offsetExists</a></strong> ( <span style="color: #0000BB">$offset</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$offset</span></td>
                  <td class="param-type-col">mixed</td>
                  <td class="param-desc-col"><p>The offset to check on</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether there is an element at the specified offset.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="offsetUnset()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#offsetUnset()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L1596" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L1596" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        offsetUnset()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Sets the element value at the specified offset to null.</strong></p>

        <p>This method is required by the SPL interface <a href="http://www.php.net/class.arrayaccess">ArrayAccess</a>.
It is implicitly called when you use something like <code>unset($model[$offset])</code>.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-db-baseactiverecord.html#offsetUnset()-detail">offsetUnset</a></strong> ( <span style="color: #0000BB">$offset</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$offset</span></td>
                  <td class="param-type-col">mixed</td>
                  <td class="param-desc-col"><p>The offset to unset element</p>
</td>
                </tr>
                                                </table>

<!--	-->

    <div class="detail-header h3" id="optimisticLock()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#optimisticLock()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L228" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L228" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        optimisticLock()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the name of the column that stores the lock version for implementing optimistic locking.</strong></p>

        <p>Optimistic locking allows multiple users to access the same record for edits and avoids
potential conflicts. In case when a user attempts to save the record upon some staled data
(because another user has modified the data), a <a href="yii-db-staleobjectexception.html">yii\db\StaleObjectException</a> exception will be thrown,
and the update or deletion is skipped.</p>
<p>Optimistic locking is only supported by <a href="yii-db-baseactiverecord.html#update()-detail">update()</a> and <a href="yii-db-baseactiverecord.html#delete()-detail">delete()</a>.</p>
<p>To use Optimistic locking:</p>
<ol>
<li>Create a column to store the version number of each row. The column type should be <code>BIGINT DEFAULT 0</code>.
Override this method to return the name of this column.</li>
<li>Add a <code>required</code> validation rule for the version column to ensure the version value is submitted.</li>
<li>In the Web form that collects the user input, add a hidden field that stores
the lock version of the recording being updated.</li>
<li>In the controller action that does the data updating, try to catch the <a href="yii-db-staleobjectexception.html">yii\db\StaleObjectException</a>
and implement necessary business logic (e.g. merging the changes, prompting stated data)
to resolve the conflict.</li>
</ol>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.string">string</a></span> <strong><a href="yii-db-baseactiverecord.html#optimisticLock()-detail">optimisticLock</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The column name that stores the lock version of a table row.
If null is returned (default implemented), optimistic locking will not be supported.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="populateRecord()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#populateRecord()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L1086" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L1086" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        populateRecord()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Populates an active record object using a row of data from the database/storage.</strong></p>

        <p>This is an internal method meant to be called to create active record objects after
fetching data from the database. It is mainly used by <a href="yii-db-activequery.html">yii\db\ActiveQuery</a> to populate
the query results into active records.</p>
<p>When calling this method manually you should call <a href="yii-db-baseactiverecord.html#afterFind()-detail">afterFind()</a> on the created
record to trigger the <a href="yii-db-baseactiverecord.html#EVENT_AFTER_FIND-detail">afterFind Event</a>.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type">void</span> <strong><a href="yii-db-baseactiverecord.html#populateRecord()-detail">populateRecord</a></strong> ( <span style="color: #0000BB">$record</span>, <span style="color: #0000BB">$row</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$record</span></td>
                  <td class="param-type-col"><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
                  <td class="param-desc-col"><p>The record to be populated. In most cases this will be an instance
created by <a href="yii-db-baseactiverecord.html#instantiate()-detail">instantiate()</a> beforehand.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$row</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Attribute values (name =&gt; value)</p>
</td>
                </tr>
                                                </table>

<!--	-->

    <div class="detail-header h3" id="populateRelation()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#populateRelation()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L396" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L396" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        populateRelation()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Populates the named relation with the related records.</strong></p>

        <p>Note that this method does not check if the relation exists or not.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-db-baseactiverecord.html#populateRelation()-detail">populateRelation</a></strong> ( <span style="color: #0000BB">$name</span>, <span style="color: #0000BB">$records</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$name</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The relation name (case-sensitive)</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$records</span></td>
                  <td class="param-type-col"><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a>|<a href="http://www.php.net/language.types.array">array</a>|<a href="http://www.php.net/language.types.null">null</a></td>
                  <td class="param-desc-col"><p>The related records to be populated into the relation.</p>
</td>
                </tr>
                                                </table>

<!--	-->

    <div class="detail-header h3" id="refresh()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#refresh()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L966" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L966" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        refresh()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Repopulates this active record with the latest data.</strong></p>

        <p>If the refresh is successful, an <a href="yii-db-baseactiverecord.html#EVENT_AFTER_REFRESH-detail">EVENT_AFTER_REFRESH</a> event will be triggered.
This event is available since version 2.0.8.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-db-baseactiverecord.html#refresh()-detail">refresh</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether the row still exists in the database. If true, the latest data
will be populated to this active record. Otherwise, this record will remain unchanged.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="save()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#save()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L595" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L595" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        save()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Saves the current record.</strong></p>

        <p>This method will call <a href="yii-db-activerecordinterface.html#insert()-detail">insert()</a> when <a href="yii-db-baseactiverecord.html#$isNewRecord-detail">$isNewRecord</a> is true, or <a href="yii-db-baseactiverecord.html#update()-detail">update()</a>
when <a href="yii-db-baseactiverecord.html#$isNewRecord-detail">$isNewRecord</a> is false.</p>
<p>For example, to save a customer record:</p>
<pre><code class="hljs php language-php"><span class="hljs-variable">$customer</span> = <span class="hljs-keyword">new</span> Customer; <span class="hljs-comment">// or $customer = Customer::findOne($id);</span>
<span class="hljs-variable">$customer</span>-&gt;name = <span class="hljs-variable">$name</span>;
<span class="hljs-variable">$customer</span>-&gt;email = <span class="hljs-variable">$email</span>;
<span class="hljs-variable">$customer</span>-&gt;save();
</code></pre>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-db-baseactiverecord.html#save()-detail">save</a></strong> ( <span style="color: #0000BB">$runValidation&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">true</span>, <span style="color: #0000BB">$attributeNames&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$runValidation</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether to perform validation (calling <a href="yii-base-model.html#validate()-detail">validate()</a>)
before saving the record. Defaults to <code>true</code>. If the validation fails, the record
will not be saved to the database and this method will return <code>false</code>.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$attributeNames</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>List of attribute names that need to be saved. Defaults to null,
meaning all attributes that are loaded from DB will be saved.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether the saving succeeded (i.e. no validation errors occurred).</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="setAttribute()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#setAttribute()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L450" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L450" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        setAttribute()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Sets the named attribute value.</strong></p>

        
        <p>See also <a href="yii-db-baseactiverecord.html#hasAttribute()-detail">hasAttribute()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-db-baseactiverecord.html#setAttribute()-detail">setAttribute</a></strong> ( <span style="color: #0000BB">$name</span>, <span style="color: #0000BB">$value</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$name</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The attribute name</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$value</span></td>
                  <td class="param-type-col">mixed</td>
                  <td class="param-desc-col"><p>The attribute value.</p>
</td>
                </tr>
                                                    <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-base-invalidparamexception.html">yii\base\InvalidParamException</a></td>
                  <td class="param-desc-col"><p>if the named attribute does not exist.</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="setIsNewRecord()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#setIsNewRecord()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L838" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L838" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        setIsNewRecord()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Sets the value indicating whether the record is new.</strong></p>

        
        <p>See also <a href="yii-db-baseactiverecord.html#getIsNewRecord()-detail">getIsNewRecord()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-db-baseactiverecord.html#setIsNewRecord()-detail">setIsNewRecord</a></strong> ( <span style="color: #0000BB">$value</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$value</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether the record is new and should be inserted when calling <a href="yii-db-baseactiverecord.html#save()-detail">save()</a>.</p>
</td>
                </tr>
                                                </table>

<!--	-->

    <div class="detail-header h3" id="setOldAttribute()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#setOldAttribute()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L500" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L500" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        setOldAttribute()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Sets the old value of the named attribute.</strong></p>

        
        <p>See also <a href="yii-db-baseactiverecord.html#hasAttribute()-detail">hasAttribute()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-db-baseactiverecord.html#setOldAttribute()-detail">setOldAttribute</a></strong> ( <span style="color: #0000BB">$name</span>, <span style="color: #0000BB">$value</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$name</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The attribute name</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$value</span></td>
                  <td class="param-type-col">mixed</td>
                  <td class="param-desc-col"><p>The old attribute value.</p>
</td>
                </tr>
                                                    <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-base-invalidparamexception.html">yii\base\InvalidParamException</a></td>
                  <td class="param-desc-col"><p>if the named attribute does not exist.</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="setOldAttributes()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#setOldAttributes()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L474" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L474" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        setOldAttributes()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Sets the old attribute values.</strong></p>

        <p>All existing old attribute values will be discarded.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-db-baseactiverecord.html#setOldAttributes()-detail">setOldAttributes</a></strong> ( <span style="color: #0000BB">$values</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$values</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a>|<a href="http://www.php.net/language.types.null">null</a></td>
                  <td class="param-desc-col"><p>Old attribute values to be set.
If set to <code>null</code> this record is considered to be <a href="yii-db-baseactiverecord.html#$isNewRecord-detail">new</a>.</p>
</td>
                </tr>
                                                </table>

<!--	-->

    <div class="detail-header h3" id="unlink()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#unlink()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L1287" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L1287" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        unlink()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Destroys the relationship between two models.</strong></p>

        <p>The model with the foreign key of the relationship will be deleted if <code>$delete</code> is true.
Otherwise, the foreign key will be set null and the model will be saved without validation.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-db-baseactiverecord.html#unlink()-detail">unlink</a></strong> ( <span style="color: #0000BB">$name</span>, <span style="color: #0000BB">$model</span>, <span style="color: #0000BB">$delete&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">false</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$name</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The case sensitive name of the relationship.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$model</span></td>
                  <td class="param-type-col"><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
                  <td class="param-desc-col"><p>The model to be unlinked from the current one.
You have to make sure that the model is really related with the current model as this method
does not check this.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$delete</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether to delete the model that contains the foreign key.
If false, the model's foreign key will be set null and saved.
If true, the model containing the foreign key will be deleted.</p>
</td>
                </tr>
                                                    <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-base-invalidcallexception.html">yii\base\InvalidCallException</a></td>
                  <td class="param-desc-col"><p>if the models cannot be unlinked</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="unlinkAll()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#unlinkAll()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L1382" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L1382" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        unlinkAll()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Destroys the relationship in current model.</strong></p>

        <p>The model with the foreign key of the relationship will be deleted if <code>$delete</code> is true.
Otherwise, the foreign key will be set null and the model will be saved without validation.</p>
<p>Note that to destroy the relationship without removing records make sure your keys can be set to null</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-db-baseactiverecord.html#unlinkAll()-detail">unlinkAll</a></strong> ( <span style="color: #0000BB">$name</span>, <span style="color: #0000BB">$delete&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">false</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$name</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The case sensitive name of the relationship.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$delete</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether to delete the model that contains the foreign key.</p>
</td>
                </tr>
                                                </table>

<!--	-->

    <div class="detail-header h3" id="update()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#update()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L656" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L656" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        update()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Saves the changes to this active record into the associated database table.</strong></p>

        <p>This method performs the following steps in order:</p>
<ol>
<li>call <a href="yii-base-model.html#beforeValidate()-detail">beforeValidate()</a> when <code>$runValidation</code> is true. If <a href="yii-base-model.html#beforeValidate()-detail">beforeValidate()</a>
returns <code>false</code>, the rest of the steps will be skipped;</li>
<li>call <a href="yii-base-model.html#afterValidate()-detail">afterValidate()</a> when <code>$runValidation</code> is true. If validation
failed, the rest of the steps will be skipped;</li>
<li>call <a href="yii-db-baseactiverecord.html#beforeSave()-detail">beforeSave()</a>. If <a href="yii-db-baseactiverecord.html#beforeSave()-detail">beforeSave()</a> returns <code>false</code>,
the rest of the steps will be skipped;</li>
<li>save the record into database. If this fails, it will skip the rest of the steps;</li>
<li>call <a href="yii-db-baseactiverecord.html#afterSave()-detail">afterSave()</a>;</li>
</ol>
<p>In the above step 1, 2, 3 and 5, events <a href="yii-base-model.html#EVENT_BEFORE_VALIDATE-detail">EVENT_BEFORE_VALIDATE</a>,
<a href="yii-base-model.html#EVENT_AFTER_VALIDATE-detail">EVENT_AFTER_VALIDATE</a>, <a href="yii-db-baseactiverecord.html#EVENT_BEFORE_UPDATE-detail">EVENT_BEFORE_UPDATE</a>, and <a href="yii-db-baseactiverecord.html#EVENT_AFTER_UPDATE-detail">EVENT_AFTER_UPDATE</a>
will be raised by the corresponding methods.</p>
<p>Only the <a href="yii-db-baseactiverecord.html#$dirtyAttributes-detail">changed attribute values</a> will be saved into database.</p>
<p>For example, to update a customer record:</p>
<pre><code class="hljs php language-php"><span class="hljs-variable">$customer</span> = Customer::findOne(<span class="hljs-variable">$id</span>);
<span class="hljs-variable">$customer</span>-&gt;name = <span class="hljs-variable">$name</span>;
<span class="hljs-variable">$customer</span>-&gt;email = <span class="hljs-variable">$email</span>;
<span class="hljs-variable">$customer</span>-&gt;update();
</code></pre>
<p>Note that it is possible the update does not affect any row in the table.
In this case, this method will return 0. For this reason, you should use the following
code to check if update() is successful or not:</p>
<pre><code class="hljs php language-php"><span class="hljs-keyword">if</span> (<span class="hljs-variable">$customer</span>-&gt;update() !== <span class="hljs-keyword">false</span>) {
    <span class="hljs-comment">// update successful</span>
} <span class="hljs-keyword">else</span> {
    <span class="hljs-comment">// update failed</span>
}
</code></pre>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.integer">integer</a>|<a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-db-baseactiverecord.html#update()-detail">update</a></strong> ( <span style="color: #0000BB">$runValidation&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">true</span>, <span style="color: #0000BB">$attributeNames&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$runValidation</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether to perform validation (calling <a href="yii-base-model.html#validate()-detail">validate()</a>)
before saving the record. Defaults to <code>true</code>. If the validation fails, the record
will not be saved to the database and this method will return <code>false</code>.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$attributeNames</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>List of attribute names that need to be saved. Defaults to null,
meaning all attributes that are loaded from DB will be saved.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.integer">integer</a>|<a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>The number of rows affected, or false if validation fails
or <a href="yii-db-baseactiverecord.html#beforeSave()-detail">beforeSave()</a> stops the updating process.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-db-staleobjectexception.html">yii\db\StaleObjectException</a></td>
                  <td class="param-desc-col"><p>if <a href="yii-db-baseactiverecord.html#optimisticLock()-detail">optimistic locking</a> is enabled and the data
being updated is outdated.</p>
</td>
                </tr>
                            <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-db-exception.html">yii\db\Exception</a></td>
                  <td class="param-desc-col"><p>in case update failed.</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="updateAll()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#updateAll()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L158" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L158" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        updateAll()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Updates the whole table using the provided attribute values and conditions.</strong></p>

        <p>For example, to change the status to be 1 for all customers whose status is 2:</p>
<pre><code class="hljs php language-php">Customer::updateAll([<span class="hljs-string">'status'</span> =&gt; <span class="hljs-number">1</span>], <span class="hljs-string">'status = 2'</span>);
</code></pre>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type"><a href="http://www.php.net/language.types.integer">integer</a></span> <strong><a href="yii-db-baseactiverecord.html#updateAll()-detail">updateAll</a></strong> ( <span style="color: #0000BB">$attributes</span>, <span style="color: #0000BB">$condition&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">''</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$attributes</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Attribute values (name-value pairs) to be saved into the table</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$condition</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a>|<a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The conditions that will be put in the WHERE part of the UPDATE SQL.
Please refer to <a href="yii-db-query.html#where()-detail">yii\db\Query::where()</a> on how to specify this parameter.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.integer">integer</a></td>
                  <td class="param-desc-col"><p>The number of rows updated</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-base-notsupportedexception.html">yii\base\NotSupportedException</a></td>
                  <td class="param-desc-col"><p>if not overridden</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="updateAllCounters()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#updateAllCounters()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L178" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L178" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        updateAllCounters()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Updates the whole table using the provided counter changes and conditions.</strong></p>

        <p>For example, to increment all customers' age by 1,</p>
<pre><code class="hljs php language-php">Customer::updateAllCounters([<span class="hljs-string">'age'</span> =&gt; <span class="hljs-number">1</span>]);
</code></pre>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type"><a href="http://www.php.net/language.types.integer">integer</a></span> <strong><a href="yii-db-baseactiverecord.html#updateAllCounters()-detail">updateAllCounters</a></strong> ( <span style="color: #0000BB">$counters</span>, <span style="color: #0000BB">$condition&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">''</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$counters</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The counters to be updated (attribute name =&gt; increment value).
Use negative values if you want to decrement the counters.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$condition</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a>|<a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The conditions that will be put in the WHERE part of the UPDATE SQL.
Please refer to <a href="yii-db-query.html#where()-detail">yii\db\Query::where()</a> on how to specify this parameter.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.integer">integer</a></td>
                  <td class="param-desc-col"><p>The number of rows updated</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-base-notsupportedexception.html">yii\base\NotSupportedException</a></td>
                  <td class="param-desc-col"><p>if not overrided</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="updateAttributes()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#updateAttributes()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L679" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L679" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        updateAttributes()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Updates the specified attributes.</strong></p>

        <p>This method is a shortcut to <a href="yii-db-baseactiverecord.html#update()-detail">update()</a> when data validation is not needed
and only a small set attributes need to be updated.</p>
<p>You may specify the attributes to be updated as name list or name-value pairs.
If the latter, the corresponding attribute values will be modified accordingly.
The method will then save the specified attributes into database.</p>
<p>Note that this method will <strong>not</strong> perform data validation and will <strong>not</strong> trigger events.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.integer">integer</a></span> <strong><a href="yii-db-baseactiverecord.html#updateAttributes()-detail">updateAttributes</a></strong> ( <span style="color: #0000BB">$attributes</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$attributes</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The attributes (names or name-value pairs) to be updated</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.integer">integer</a></td>
                  <td class="param-desc-col"><p>The number of rows affected.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="updateCounters()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#updateCounters()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L766" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L766" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        updateCounters()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Updates one or several counter columns for the current AR object.</strong></p>

        <p>Note that this method differs from <a href="yii-db-baseactiverecord.html#updateAllCounters()-detail">updateAllCounters()</a> in that it only
saves counters for the current AR object.</p>
<p>An example usage is as follows:</p>
<pre><code class="hljs php language-php"><span class="hljs-variable">$post</span> = Post::findOne(<span class="hljs-variable">$id</span>);
<span class="hljs-variable">$post</span>-&gt;updateCounters([<span class="hljs-string">'view_count'</span> =&gt; <span class="hljs-number">1</span>]);
</code></pre>

        <p>See also <a href="yii-db-baseactiverecord.html#updateAllCounters()-detail">updateAllCounters()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-db-baseactiverecord.html#updateCounters()-detail">updateCounters</a></strong> ( <span style="color: #0000BB">$counters</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$counters</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The counters to be updated (attribute name =&gt; increment value)
Use negative values if you want to decrement the counters.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether the saving is successful</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="updateInternal()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#updateInternal()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L711" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L711" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        updateInternal()
        <span class="detail-header-tag small">
            protected                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong></strong></p>

        
        <p>See also <a href="yii-db-baseactiverecord.html#update()-detail">update()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">protected</span> <span class="signature-type"><a href="http://www.php.net/language.types.integer">integer</a></span> <strong><a href="yii-db-baseactiverecord.html#updateInternal()-detail">updateInternal</a></strong> ( <span style="color: #0000BB">$attributes&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$attributes</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Attributes to update</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.integer">integer</a></td>
                  <td class="param-desc-col"><p>Number of rows updated</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-db-staleobjectexception.html">yii\db\StaleObjectException</a></td>
                  <td class="param-desc-col"></td>
                </tr>
                        </table>

<!--	-->
</div>
    <h2>Event Details</h2>

<div class="event-doc">
    <div class="detail-header h3" id="EVENT_AFTER_DELETE-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#EVENT_AFTER_DELETE-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L79" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L79" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        EVENT_AFTER_DELETE        <span class="detail-header-tag small">
        event
        of type <a href="yii-base-event.html">yii\base\Event</a>                </span>
    </div>

    <div class="doc-description">
        <p>An event that is triggered after a record is deleted.</p>

            </div>

    <div class="detail-header h3" id="EVENT_AFTER_FIND-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#EVENT_AFTER_FIND-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L52" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L52" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        EVENT_AFTER_FIND        <span class="detail-header-tag small">
        event
        of type <a href="yii-base-event.html">yii\base\Event</a>                </span>
    </div>

    <div class="doc-description">
        <p>An event that is triggered after the record is created and populated with query result.</p>

            </div>

    <div class="detail-header h3" id="EVENT_AFTER_INSERT-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#EVENT_AFTER_INSERT-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L61" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L61" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        EVENT_AFTER_INSERT        <span class="detail-header-tag small">
        event
        of type <a href="yii-db-aftersaveevent.html">yii\db\AfterSaveEvent</a>                </span>
    </div>

    <div class="doc-description">
        <p>An event that is triggered after a record is inserted.</p>

            </div>

    <div class="detail-header h3" id="EVENT_AFTER_REFRESH-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#EVENT_AFTER_REFRESH-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L84" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L84" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        EVENT_AFTER_REFRESH        <span class="detail-header-tag small">
        event
        of type <a href="yii-base-event.html">yii\base\Event</a>                    (available since version 2.0.8)
                </span>
    </div>

    <div class="doc-description">
        <p>An event that is triggered after a record is refreshed.</p>

            </div>

    <div class="detail-header h3" id="EVENT_AFTER_UPDATE-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#EVENT_AFTER_UPDATE-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L70" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L70" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        EVENT_AFTER_UPDATE        <span class="detail-header-tag small">
        event
        of type <a href="yii-db-aftersaveevent.html">yii\db\AfterSaveEvent</a>                </span>
    </div>

    <div class="doc-description">
        <p>An event that is triggered after a record is updated.</p>

            </div>

    <div class="detail-header h3" id="EVENT_BEFORE_DELETE-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#EVENT_BEFORE_DELETE-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L75" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L75" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        EVENT_BEFORE_DELETE        <span class="detail-header-tag small">
        event
        of type <a href="yii-base-modelevent.html">yii\base\ModelEvent</a>                </span>
    </div>

    <div class="doc-description">
        <p>An event that is triggered before deleting a record.
You may set <a href="yii-base-modelevent.html#$isValid-detail">yii\base\ModelEvent::$isValid</a> to be false to stop the deletion.</p>

            </div>

    <div class="detail-header h3" id="EVENT_BEFORE_INSERT-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#EVENT_BEFORE_INSERT-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L57" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L57" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        EVENT_BEFORE_INSERT        <span class="detail-header-tag small">
        event
        of type <a href="yii-base-modelevent.html">yii\base\ModelEvent</a>                </span>
    </div>

    <div class="doc-description">
        <p>An event that is triggered before inserting a record.
You may set <a href="yii-base-modelevent.html#$isValid-detail">yii\base\ModelEvent::$isValid</a> to be false to stop the insertion.</p>

            </div>

    <div class="detail-header h3" id="EVENT_BEFORE_UPDATE-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#EVENT_BEFORE_UPDATE-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L66" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L66" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        EVENT_BEFORE_UPDATE        <span class="detail-header-tag small">
        event
        of type <a href="yii-base-modelevent.html">yii\base\ModelEvent</a>                </span>
    </div>

    <div class="doc-description">
        <p>An event that is triggered before updating a record.
You may set <a href="yii-base-modelevent.html#$isValid-detail">yii\base\ModelEvent::$isValid</a> to be false to stop the update.</p>

            </div>

    <div class="detail-header h3" id="EVENT_INIT-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-db-baseactiverecord.html#EVENT_INIT-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2/edit/master/framework/db/BaseActiveRecord.php#L48" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L48" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        EVENT_INIT        <span class="detail-header-tag small">
        event
        of type <a href="yii-base-event.html">yii\base\Event</a>                </span>
    </div>

    <div class="doc-description">
        <p>An event that is triggered when the record is initialized via <a href="yii-db-baseactiverecord.html#init()-detail">init()</a>.</p>

            </div>

</div>
    </div>
</div>

<script type="text/javascript">
    /*<![CDATA[*/
    $("a.toggle").on('click', function () {
        var $this = $(this);
        if ($this.hasClass('properties-hidden')) {
            $this.text($this.text().replace(/Show/,'Hide'));
            $this.parents(".summary").find(".inherited").show();
            $this.removeClass('properties-hidden');
        } else {
            $this.text($this.text().replace(/Hide/,'Show'));
            $this.parents(".summary").find(".inherited").hide();
            $this.addClass('properties-hidden');
        }

        return false;
    });
    /*
     $(".sourceCode a.show").toggle(function () {
     $(this).text($(this).text().replace(/show/,'hide'));
     $(this).parents(".sourceCode").find("div.code").show();
     },function () {
     $(this).text($(this).text().replace(/hide/,'show'));
     $(this).parents(".sourceCode").find("div.code").hide();
     });
     $("a.sourceLink").click(function () {
     $(this).attr('target','_blank');
     });
     */
    /*]]>*/
</script>


</div>

<footer class="footer">
        <p class="pull-right"><small>Page generated on Sat, 09 Jul 2016 12:15:47 +0000</small></p>
    Powered by <a href="http://www.yiiframework.com/" rel="external">Yii Framework</a></footer>

<script type="text/javascript">jQuery(document).ready(function () {
    var shiftWindow = function () { scrollBy(0, -50) };
    if (location.hash) setTimeout(shiftWindow, 1);
    window.addEventListener("hashchange", shiftWindow);
var element = document.createElement("script");
element.src = "./jssearch.index.js";
document.body.appendChild(element);

var searchBox = $('#searchbox');

// search when typing in search field
searchBox.on("keyup", function(event) {
    var query = $(this).val();

    if (query == '' || event.which == 27) {
        $('#search-resultbox').hide();
        return;
    } else if (event.which == 13) {
        var selectedLink = $('#search-resultbox a.selected');
        if (selectedLink.length != 0) {
            document.location = selectedLink.attr('href');
            return;
        }
    } else if (event.which == 38 || event.which == 40) {
        $('#search-resultbox').show();

        var selected = $('#search-resultbox a.selected');
        if (selected.length == 0) {
            $('#search-results').find('a').first().addClass('selected');
        } else {
            var next;
            if (event.which == 40) {
                next = selected.parent().next().find('a').first();
            } else {
                next = selected.parent().prev().find('a').first();
            }
            if (next.length != 0) {
                var resultbox = $('#search-results');
                var position = next.position();

//              TODO scrolling is buggy and jumps around
//                resultbox.scrollTop(Math.floor(position.top));
//                console.log(position.top);

                selected.removeClass('selected');
                next.addClass('selected');
            }
        }

        return;
    }
    $('#search-resultbox').show();
    $('#search-results').html('<li><span class="no-results">No results</span></li>');

    var result = jssearch.search(query);

    if (result.length > 0) {
        var i = 0;
        var resHtml = '';

        for (var key in result) {
            if (i++ > 20) {
                break;
            }
            resHtml = resHtml +
            '<li><a href="' + result[key].file.u.substr(3) +'"><span class="title">' + result[key].file.t + '</span>' +
            '<span class="description">' + result[key].file.d + '</span></a></li>';
        }
        $('#search-results').html(resHtml);
    }
});

// hide the search results on ESC
$(document).on("keyup", function(event) { if (event.which == 27) { $('#search-resultbox').hide(); } });
// hide search results on click to document
$(document).bind('click', function (e) { $('#search-resultbox').hide(); });
// except the following:
searchBox.bind('click', function(e) { e.stopPropagation(); });
$('#search-resultbox').bind('click', function(e) { e.stopPropagation(); });

});</script></body>
</html>
